diff options
Diffstat (limited to 'test/git')
-rw-r--r-- | test/git/test_base.py | 4 | ||||
-rw-r--r-- | test/git/test_blob.py | 6 | ||||
-rw-r--r-- | test/git/test_commit.py | 16 | ||||
-rw-r--r-- | test/git/test_index.py | 2 | ||||
-rw-r--r-- | test/git/test_repo.py | 10 | ||||
-rw-r--r-- | test/git/test_tree.py | 2 |
6 files changed, 20 insertions, 20 deletions
diff --git a/test/git/test_base.py b/test/git/test_base.py index 1b78786a..497f90fb 100644 --- a/test/git/test_base.py +++ b/test/git/test_base.py @@ -32,13 +32,13 @@ class TestBase(TestBase): for obj_type, (typename, hexsha) in zip(types, self.type_tuples): item = obj_type(self.rorepo,hexsha) num_objs += 1 - assert item.id == hexsha + assert item.sha == hexsha assert item.type == typename assert item.size assert item.data assert item == item assert not item != item - assert str(item) == item.id + assert str(item) == item.sha assert repr(item) s.add(item) diff --git a/test/git/test_blob.py b/test/git/test_blob.py index 1b3b68f8..464cfd6b 100644 --- a/test/git/test_blob.py +++ b/test/git/test_blob.py @@ -18,13 +18,13 @@ class TestBlob(TestBase): blob.size def test_mime_type_should_return_mime_type_for_known_types(self): - blob = Blob(self.rorepo, **{'id': 'abc', 'path': 'foo.png'}) + blob = Blob(self.rorepo, **{'sha': 'abc', 'path': 'foo.png'}) assert_equal("image/png", blob.mime_type) def test_mime_type_should_return_text_plain_for_unknown_types(self): - blob = Blob(self.rorepo, **{'id': 'abc','path': 'something'}) + blob = Blob(self.rorepo, **{'sha': 'abc','path': 'something'}) assert_equal("text/plain", blob.mime_type) def test_should_return_appropriate_representation(self): - blob = Blob(self.rorepo, **{'id': 'abc'}) + blob = Blob(self.rorepo, **{'sha': 'abc'}) assert_equal('<git.Blob "abc">', repr(blob)) diff --git a/test/git/test_commit.py b/test/git/test_commit.py index af952ed1..be6d1a28 100644 --- a/test/git/test_commit.py +++ b/test/git/test_commit.py @@ -11,7 +11,7 @@ class TestCommit(TestBase): def test_bake(self): - commit = Commit(self.rorepo, **{'id': '2454ae89983a4496a445ce347d7a41c0bb0ea7ae'}) + commit = Commit(self.rorepo, **{'sha': '2454ae89983a4496a445ce347d7a41c0bb0ea7ae'}) commit.author # bake assert_equal("Sebastian Thiel", commit.author.name) @@ -22,7 +22,7 @@ class TestCommit(TestBase): def test_stats(self): - commit = Commit(self.rorepo, id='33ebe7acec14b25c5f84f35a664803fcab2f7781') + commit = Commit(self.rorepo, '33ebe7acec14b25c5f84f35a664803fcab2f7781') stats = commit.stats def check_entries(d): @@ -72,7 +72,7 @@ class TestCommit(TestBase): 'c231551328faa864848bde6ff8127f59c9566e90', ) for sha1, commit in zip(expected_ids, commits): - assert_equal(sha1, commit.id) + assert_equal(sha1, commit.sha) def test_count(self): assert self.rorepo.tag('refs/tags/0.1.5').commit.count( ) == 141 @@ -81,17 +81,17 @@ class TestCommit(TestBase): assert isinstance(Commit.list_items(self.rorepo, '0.1.5', max_count=5)['5117c9c8a4d3af19a9958677e45cda9269de1541'], Commit) def test_str(self): - commit = Commit(self.rorepo, id='abc') + commit = Commit(self.rorepo, 'abc') assert_equal ("abc", str(commit)) def test_repr(self): - commit = Commit(self.rorepo, id='abc') + commit = Commit(self.rorepo, 'abc') assert_equal('<git.Commit "abc">', repr(commit)) def test_equality(self): - commit1 = Commit(self.rorepo, id='abc') - commit2 = Commit(self.rorepo, id='abc') - commit3 = Commit(self.rorepo, id='zyx') + commit1 = Commit(self.rorepo, 'abc') + commit2 = Commit(self.rorepo, 'abc') + commit3 = Commit(self.rorepo, 'zyx') assert_equal(commit1, commit2) assert_not_equal(commit2, commit3) diff --git a/test/git/test_index.py b/test/git/test_index.py index 3345949b..e9541232 100644 --- a/test/git/test_index.py +++ b/test/git/test_index.py @@ -309,7 +309,7 @@ class TestTree(TestBase): # blob from older revision overrides current index revision old_blob = new_commit.parents[0].tree.blobs[0] entries = index.reset(new_commit).add([old_blob]) - assert index.entries[(old_blob.path,0)].sha == old_blob.id and len(entries) == 1 + assert index.entries[(old_blob.path,0)].sha == old_blob.sha and len(entries) == 1 # mode 0 not allowed null_sha = "0"*40 diff --git a/test/git/test_repo.py b/test/git/test_repo.py index 146cff1a..df495e71 100644 --- a/test/git/test_repo.py +++ b/test/git/test_repo.py @@ -46,9 +46,9 @@ class TestRepo(TestBase): commits = list( self.rorepo.iter_commits('master', max_count=10) ) c = commits[0] - assert_equal('4c8124ffcf4039d292442eeccabdeca5af5c5017', c.id) - assert_equal(["634396b2f541a9f2d58b00be1a07f0c358b999b3"], [p.id for p in c.parents]) - assert_equal("672eca9b7f9e09c22dcb128c283e8c3c8d7697a4", c.tree.id) + assert_equal('4c8124ffcf4039d292442eeccabdeca5af5c5017', c.sha) + assert_equal(["634396b2f541a9f2d58b00be1a07f0c358b999b3"], [p.sha for p in c.parents]) + assert_equal("672eca9b7f9e09c22dcb128c283e8c3c8d7697a4", c.tree.sha) assert_equal("Tom Preston-Werner", c.author.name) assert_equal("tom@mojombo.com", c.author.email) assert_equal(1191999972, c.authored_date) @@ -61,7 +61,7 @@ class TestRepo(TestBase): assert_equal(tuple(), c.parents) c = commits[2] - assert_equal(["6e64c55896aabb9a7d8e9f8f296f426d21a78c2c", "7f874954efb9ba35210445be456c74e037ba6af2"], map(lambda p: p.id, c.parents)) + assert_equal(["6e64c55896aabb9a7d8e9f8f296f426d21a78c2c", "7f874954efb9ba35210445be456c74e037ba6af2"], map(lambda p: p.sha, c.parents)) assert_equal("Merge branch 'site'", c.summary) assert_true(git.called) @@ -195,7 +195,7 @@ class TestRepo(TestBase): assert_true(git.called) assert_equal(git.call_args, (('blame', 'master', '--', 'lib/git.py'), {'p': True})) - assert_equal('634396b2f541a9f2d58b00be1a07f0c358b999b3', c.id) + assert_equal('634396b2f541a9f2d58b00be1a07f0c358b999b3', c.sha) assert_equal('Tom Preston-Werner', c.author.name) assert_equal('tom@mojombo.com', c.author.email) assert_equal(1191997100, c.authored_date) diff --git a/test/git/test_tree.py b/test/git/test_tree.py index b359e2d2..64a7900a 100644 --- a/test/git/test_tree.py +++ b/test/git/test_tree.py @@ -45,5 +45,5 @@ class TestTree(TestCase): assert len(set(b for b in root if isinstance(b, Blob)) | set(root.blobs)) == len( root.blobs ) def test_repr(self): - tree = Tree(self.repo, id='abc') + tree = Tree(self.repo, 'abc') assert_equal('<git.Tree "abc">', repr(tree)) |