77from test .testlib import *
88from git import *
99
10- class TestCommit (object ):
11- def setup (self ):
12- self .repo = Repo (GIT_REPO )
10+ class TestCommit (TestBase ):
1311
1412 def test_bake (self ):
1513
16- commit = Commit (self .repo , ** {'id' : '2454ae89983a4496a445ce347d7a41c0bb0ea7ae' })
14+ commit = Commit (self .rorepo , ** {'id' : '2454ae89983a4496a445ce347d7a41c0bb0ea7ae' })
1715 commit .author # bake
1816
1917 assert_equal ("Sebastian Thiel" , commit .author .name )
2018 assert_equal ("byronimo@gmail.com" , commit .author .email )
2119
2220
2321 def test_stats (self ):
24- commit = Commit (self .repo , id = '33ebe7acec14b25c5f84f35a664803fcab2f7781' )
22+ commit = Commit (self .rorepo , id = '33ebe7acec14b25c5f84f35a664803fcab2f7781' )
2523 stats = commit .stats
2624
2725 def check_entries (d ):
@@ -48,13 +46,13 @@ def test_rev_list_bisect_all(self, git):
4846
4947 git .return_value = fixture ('rev_list_bisect_all' )
5048
51- revs = self .repo .git .rev_list ('HEAD' ,
49+ revs = self .rorepo .git .rev_list ('HEAD' ,
5250 pretty = 'raw' ,
5351 first_parent = True ,
5452 bisect_all = True )
5553 assert_true (git .called )
5654
57- commits = Commit ._iter_from_process_or_stream (self .repo , ListProcessAdapter (revs ))
55+ commits = Commit ._iter_from_process_or_stream (self .rorepo , ListProcessAdapter (revs ))
5856 expected_ids = (
5957 'cf37099ea8d1d8c7fbf9b6d12d7ec0249d3acb8b' ,
6058 '33ebe7acec14b25c5f84f35a664803fcab2f7781' ,
@@ -66,29 +64,29 @@ def test_rev_list_bisect_all(self, git):
6664 assert_equal (sha1 , commit .id )
6765
6866 def test_count (self ):
69- assert self .repo .tag ('0.1.5' ).commit .count ( ) == 141
67+ assert self .rorepo .tag ('0.1.5' ).commit .count ( ) == 141
7068
7169 def test_list (self ):
72- assert isinstance (Commit .list_items (self .repo , '0.1.5' , max_count = 5 )['5117c9c8a4d3af19a9958677e45cda9269de1541' ], Commit )
70+ assert isinstance (Commit .list_items (self .rorepo , '0.1.5' , max_count = 5 )['5117c9c8a4d3af19a9958677e45cda9269de1541' ], Commit )
7371
7472 def test_str (self ):
75- commit = Commit (self .repo , id = 'abc' )
73+ commit = Commit (self .rorepo , id = 'abc' )
7674 assert_equal ("abc" , str (commit ))
7775
7876 def test_repr (self ):
79- commit = Commit (self .repo , id = 'abc' )
77+ commit = Commit (self .rorepo , id = 'abc' )
8078 assert_equal ('<git.Commit "abc">' , repr (commit ))
8179
8280 def test_equality (self ):
83- commit1 = Commit (self .repo , id = 'abc' )
84- commit2 = Commit (self .repo , id = 'abc' )
85- commit3 = Commit (self .repo , id = 'zyx' )
81+ commit1 = Commit (self .rorepo , id = 'abc' )
82+ commit2 = Commit (self .rorepo , id = 'abc' )
83+ commit3 = Commit (self .rorepo , id = 'zyx' )
8684 assert_equal (commit1 , commit2 )
8785 assert_not_equal (commit2 , commit3 )
8886
8987 def test_iter_parents (self ):
9088 # should return all but ourselves, even if skip is defined
91- c = self .repo .commit ('0.1.5' )
89+ c = self .rorepo .commit ('0.1.5' )
9290 for skip in (0 , 1 ):
9391 piter = c .iter_parents (skip = skip )
9492 first_parent = piter .next ()
0 commit comments