diff options
author | Michael Trier <mtrier@gmail.com> | 2010-03-03 23:46:23 -0500 |
---|---|---|
committer | Michael Trier <mtrier@gmail.com> | 2010-03-03 23:46:23 -0500 |
commit | e3e2c8c14b861b4d4865a9574e812ef9f2609771 (patch) | |
tree | c71c7da3843389ea3b7041a0200d7abe3b0e580d /test | |
parent | acb0fa8b94ef421ad60c8507b634759a472cd56c (diff) | |
download | gitpython-e3e2c8c14b861b4d4865a9574e812ef9f2609771.tar.gz |
Corrected a bunch of whitespace that makes some folks crazy. Added Sebastian to the AUTHORS file.
Diffstat (limited to 'test')
-rw-r--r-- | test/__init__.py | 2 | ||||
-rw-r--r-- | test/git/__init__.py | 2 | ||||
-rw-r--r-- | test/git/test_actor.py | 2 | ||||
-rw-r--r-- | test/git/test_blob.py | 22 | ||||
-rw-r--r-- | test/git/test_commit.py | 2 | ||||
-rw-r--r-- | test/git/test_diff.py | 2 | ||||
-rw-r--r-- | test/git/test_git.py | 2 | ||||
-rw-r--r-- | test/git/test_head.py | 8 | ||||
-rw-r--r-- | test/git/test_repo.py | 8 | ||||
-rw-r--r-- | test/git/test_stats.py | 10 | ||||
-rw-r--r-- | test/git/test_tag.py | 12 | ||||
-rw-r--r-- | test/git/test_tree.py | 36 | ||||
-rw-r--r-- | test/git/test_utils.py | 2 | ||||
-rw-r--r-- | test/testlib/__init__.py | 2 | ||||
-rw-r--r-- | test/testlib/asserts.py | 8 | ||||
-rw-r--r-- | test/testlib/helper.py | 2 |
16 files changed, 61 insertions, 61 deletions
diff --git a/test/__init__.py b/test/__init__.py index 757cbad1..ca6ed8dc 100644 --- a/test/__init__.py +++ b/test/__init__.py @@ -1,5 +1,5 @@ # __init__.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php diff --git a/test/git/__init__.py b/test/git/__init__.py index 757cbad1..ca6ed8dc 100644 --- a/test/git/__init__.py +++ b/test/git/__init__.py @@ -1,5 +1,5 @@ # __init__.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php diff --git a/test/git/test_actor.py b/test/git/test_actor.py index 862010fc..bdedf8d9 100644 --- a/test/git/test_actor.py +++ b/test/git/test_actor.py @@ -1,5 +1,5 @@ # test_actor.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php diff --git a/test/git/test_blob.py b/test/git/test_blob.py index 5bd74ff7..607f2378 100644 --- a/test/git/test_blob.py +++ b/test/git/test_blob.py @@ -1,5 +1,5 @@ # test_blob.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php @@ -11,7 +11,7 @@ from git import * class TestBlob(object): def setup(self): self.repo = Repo(GIT_REPO) - + @patch_object(Git, '_call_process') def test_should_return_blob_contents(self, git): git.return_value = fixture('cat_file_blob') @@ -27,7 +27,7 @@ class TestBlob(object): assert_equal("Hello world\n", blob.data) assert_true(git.called) assert_equal(git.call_args, (('cat_file', 'abc'), {'p': True, 'with_raw_output': True})) - + @patch_object(Git, '_call_process') def test_should_cache_data(self, git): git.return_value = fixture('cat_file_blob') @@ -55,15 +55,15 @@ class TestBlob(object): assert_true(git.called) assert_equal(git.call_count, 1) assert_equal(git.call_args, (('cat_file', 'abc'), {'s': True})) - + def test_mime_type_should_return_mime_type_for_known_types(self): blob = Blob(self.repo, **{'id': 'abc', 'name': 'foo.png'}) assert_equal("image/png", blob.mime_type) - + def test_mime_type_should_return_text_plain_for_unknown_types(self): blob = Blob(self.repo, **{'id': 'abc'}) assert_equal("text/plain", blob.mime_type) - + @patch_object(Git, '_call_process') def test_should_display_blame_information(self, git): git.return_value = fixture('blame') @@ -75,7 +75,7 @@ class TestBlob(object): c = b[0][0] assert_true(git.called) assert_equal(git.call_args, (('blame', 'master', '--', 'lib/git.py'), {'p': True})) - + assert_equal('634396b2f541a9f2d58b00be1a07f0c358b999b3', c.id) assert_equal('Tom Preston-Werner', c.author.name) assert_equal('tom@mojombo.com', c.author.email) @@ -84,14 +84,14 @@ class TestBlob(object): assert_equal('tom@mojombo.com', c.committer.email) assert_equal(time.gmtime(1191997100), c.committed_date) assert_equal('initial grit setup', c.message) - + # test the 'lines per commit' entries tlist = b[0][1] assert_true( tlist ) assert_true( isinstance( tlist[0], basestring ) ) - assert_true( len( tlist ) < sum( len(t) for t in tlist ) ) # test for single-char bug - - + assert_true( len( tlist ) < sum( len(t) for t in tlist ) ) # test for single-char bug + + def test_should_return_appropriate_representation(self): blob = Blob(self.repo, **{'id': 'abc'}) assert_equal('<git.Blob "abc">', repr(blob)) diff --git a/test/git/test_commit.py b/test/git/test_commit.py index 3e37a7a4..2fa47952 100644 --- a/test/git/test_commit.py +++ b/test/git/test_commit.py @@ -1,5 +1,5 @@ # test_commit.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php diff --git a/test/git/test_diff.py b/test/git/test_diff.py index 65a27e98..61ab82fb 100644 --- a/test/git/test_diff.py +++ b/test/git/test_diff.py @@ -1,5 +1,5 @@ # test_diff.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php diff --git a/test/git/test_git.py b/test/git/test_git.py index 6e28f4c0..079427ed 100644 --- a/test/git/test_git.py +++ b/test/git/test_git.py @@ -1,5 +1,5 @@ # test_git.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php diff --git a/test/git/test_head.py b/test/git/test_head.py index e3408974..ab310276 100644 --- a/test/git/test_head.py +++ b/test/git/test_head.py @@ -1,5 +1,5 @@ # test_head.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php @@ -14,11 +14,11 @@ class TestHead(object): @patch_object(Git, '_call_process') def test_repr(self, git): git.return_value = fixture('for_each_ref') - + head = self.repo.heads[0] - + assert_equal('<git.Head "%s">' % head.name, repr(head)) - + assert_true(git.called) assert_equal(git.call_args, (('for_each_ref', 'refs/heads'), {'sort': 'committerdate', 'format': '%(refname)%00%(objectname)'})) diff --git a/test/git/test_repo.py b/test/git/test_repo.py index abf17be8..19fb0691 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -1,5 +1,5 @@ # test_repo.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php @@ -12,7 +12,7 @@ from git import * class TestRepo(object): def setup(self): self.repo = Repo(GIT_REPO) - + @raises(InvalidGitRepositoryError) def test_new_should_raise_on_invalid_repo_location(self): if sys.platform == "win32": @@ -199,12 +199,12 @@ class TestRepo(object): self.repo.archive_tar_gz() def test_disable_daemon_export(self): - prev_value = self.repo.daemon_export + prev_value = self.repo.daemon_export self.repo.daemon_export = not prev_value assert_equal(self.repo.daemon_export, not prev_value) self.repo.daemon_export = prev_value assert_equal(self.repo.daemon_export, prev_value) - + def test_alternates(self): cur_alternates = self.repo.alternates # empty alternates diff --git a/test/git/test_stats.py b/test/git/test_stats.py index b6f1b60e..c089bc39 100644 --- a/test/git/test_stats.py +++ b/test/git/test_stats.py @@ -1,5 +1,5 @@ # test_stats.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php @@ -10,18 +10,18 @@ from git import * class TestStats(object): def setup(self): self.repo = Repo(GIT_REPO) - + def test_list_from_string(self): output = fixture('diff_numstat') stats = Stats.list_from_string(self.repo, output) - + assert_equal(2, stats.total['files']) assert_equal(52, stats.total['lines']) assert_equal(29, stats.total['insertions']) assert_equal(23, stats.total['deletions']) - + assert_equal(29, stats.files["a.txt"]['insertions']) assert_equal(18, stats.files["a.txt"]['deletions']) - + assert_equal(0, stats.files["b.txt"]['insertions']) assert_equal(5, stats.files["b.txt"]['deletions']) diff --git a/test/git/test_tag.py b/test/git/test_tag.py index 732bbd45..3df617ce 100644 --- a/test/git/test_tag.py +++ b/test/git/test_tag.py @@ -1,5 +1,5 @@ # test_tag.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php @@ -15,22 +15,22 @@ class TestTag(object): @patch_object(Git, '_call_process') def test_list_from_string(self, git): git.return_value = fixture('for_each_ref_tags') - + tags = self.repo.tags - + assert_equal(1, len(tags)) assert_equal('v0.7.1', tags[0].name) assert_equal('634396b2f541a9f2d58b00be1a07f0c358b999b3', tags[0].commit.id) - + assert_true(git.called) assert_equal(git.call_args, (('for_each_ref', 'refs/tags'), {'sort': 'committerdate', 'format': '%(refname)%00%(objectname)'})) @patch_object(Git, '_call_process') def test_repr(self, git): git.return_value = fixture('for_each_ref') - + tag = self.repo.tags[0] assert_equal('<git.Tag "%s">' % tag.name, repr(tag)) - + assert_true(git.called) assert_equal(git.call_args, (('for_each_ref', 'refs/tags'), {'sort': 'committerdate', 'format': '%(refname)%00%(objectname)'})) diff --git a/test/git/test_tree.py b/test/git/test_tree.py index 947b0ffb..0ab6b9bc 100644 --- a/test/git/test_tree.py +++ b/test/git/test_tree.py @@ -1,5 +1,5 @@ # test_tree.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php @@ -14,17 +14,17 @@ class TestTree(object): @patch_object(Git, '_call_process') def test_contents_should_cache(self, git): git.return_value = fixture('ls_tree_a') + fixture('ls_tree_b') - + tree = self.repo.tree('master') child = tree['grit'] child.items() child.items() - + assert_true(git.called) assert_equal(2, git.call_count) assert_equal(git.call_args, (('ls_tree', '34868e6e7384cb5ee51c543a8187fdff2675b5a7'), {})) - + def test_content_from_string_tree_should_return_tree(self): text = fixture('ls_tree_a').splitlines()[-1] tree = Tree.content_from_string(None, text) @@ -33,23 +33,23 @@ class TestTree(object): assert_equal("650fa3f0c17f1edb4ae53d8dcca4ac59d86e6c44", tree.id) assert_equal("040000", tree.mode) assert_equal("test", tree.name) - + def test_content_from_string_tree_should_return_blob(self): text = fixture('ls_tree_b').split("\n")[0] - + tree = Tree.content_from_string(None, text) assert_equal(Blob, tree.__class__) assert_equal("aa94e396335d2957ca92606f909e53e7beaf3fbb", tree.id) assert_equal("100644", tree.mode) assert_equal("grit.rb", tree.name) - + def test_content_from_string_tree_should_return_commit(self): text = fixture('ls_tree_commit').split("\n")[1] - + tree = Tree.content_from_string(None, text) assert_none(tree) - + @raises(TypeError) def test_content_from_string_invalid_type_should_raise(self): Tree.content_from_string(None, "040000 bogus 650fa3f0c17f1edb4ae53d8dcca4ac59d86e6c44 test") @@ -59,35 +59,35 @@ class TestTree(object): def test_slash(self, git, blob): git.return_value = fixture('ls_tree_a') blob.return_value = 1 - + tree = self.repo.tree('master') - + assert_equal('aa06ba24b4e3f463b3c4a85469d0fb9e5b421cf8', (tree/'lib').id) assert_equal('8b1e02c0fb554eed2ce2ef737a68bb369d7527df', (tree/'README.txt').id) - + assert_true(git.called) assert_equal(git.call_args, (('ls_tree', 'master'), {})) - + @patch_object(Blob, 'size') @patch_object(Git, '_call_process') def test_slash_with_zero_length_file(self, git, blob): git.return_value = fixture('ls_tree_a') blob.return_value = 0 - + tree = self.repo.tree('master') - + assert_not_none(tree/'README.txt') assert_equal('8b1e02c0fb554eed2ce2ef737a68bb369d7527df', (tree/'README.txt').id) - + assert_true(git.called) assert_equal(git.call_args, (('ls_tree', 'master'), {})) - + @patch_object(Git, '_call_process') def test_slash_with_commits(self, git): git.return_value = fixture('ls_tree_commit') tree = self.repo.tree('master') - + assert_none(tree/'bar') assert_equal('2afb47bcedf21663580d5e6d2f406f08f3f65f19', (tree/'foo').id) assert_equal('f623ee576a09ca491c4a27e48c0dfe04be5f4a2e', (tree/'baz').id) diff --git a/test/git/test_utils.py b/test/git/test_utils.py index 327a07ed..36e9c4bb 100644 --- a/test/git/test_utils.py +++ b/test/git/test_utils.py @@ -1,5 +1,5 @@ # test_utils.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php diff --git a/test/testlib/__init__.py b/test/testlib/__init__.py index 77512794..e4136fcd 100644 --- a/test/testlib/__init__.py +++ b/test/testlib/__init__.py @@ -1,5 +1,5 @@ # __init__.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php diff --git a/test/testlib/asserts.py b/test/testlib/asserts.py index f66af122..9a7b4050 100644 --- a/test/testlib/asserts.py +++ b/test/testlib/asserts.py @@ -1,5 +1,5 @@ # asserts.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php @@ -9,7 +9,7 @@ import unittest from nose import tools from nose.tools import * -__all__ = ['assert_instance_of', 'assert_not_instance_of', +__all__ = ['assert_instance_of', 'assert_not_instance_of', 'assert_none', 'assert_not_none', 'assert_match', 'assert_not_match'] + tools.__all__ @@ -20,7 +20,7 @@ def assert_instance_of(expected, actual, msg=None): def assert_not_instance_of(expected, actual, msg=None): """Verify that object is not an instance of expected """ assert not isinstance(actual, expected, msg) - + def assert_none(actual, msg=None): """verify that item is None""" assert_equal(None, actual, msg) @@ -35,4 +35,4 @@ def assert_match(pattern, string, msg=None): def assert_not_match(pattern, string, msg=None): """verify that the pattern does not match the string""" - assert_none(re.search(pattern, string), msg)
\ No newline at end of file + assert_none(re.search(pattern, string), msg) diff --git a/test/testlib/helper.py b/test/testlib/helper.py index ca262ee4..94675249 100644 --- a/test/testlib/helper.py +++ b/test/testlib/helper.py @@ -1,5 +1,5 @@ # helper.py -# Copyright (C) 2008, 2009 Michael Trier (mtrier@gmail.com) and contributors +# Copyright (C) 2008-2010 Michael Trier (mtrier@gmail.com) and contributors # # This module is part of GitPython and is released under # the BSD License: http://www.opensource.org/licenses/bsd-license.php |