@@ -35,12 +35,34 @@ def test_sha(self):
3535 def test_size (self ):
3636 expect_str (self .blob .size )
3737
38+
39+ class TestCommit (BaseTest ):
40+ def __init__ (self , methodName = 'runTest' ):
41+ r = self .g .repository (self .sigm , self .todo )
42+ self .commit = r .git_commit ('8b0704374914f03a54b89d938de1c09d5831824e' )
43+
3844 def test_commit (self ):
39- r = self .todor
40- commit = r .git_commit ('8b0704374914f03a54b89d938de1c09d5831824e' )
41- expect (commit ).isinstance (Commit )
42- self .assertAreNotNone (commit , 'author' , 'committer' , 'tree' , 'message' ,
43- 'parents' , 'sha' )
45+ expect (self .commit ).isinstance (Commit )
46+ expect_str (repr (self .commit ))
47+
48+ def test_author (self ):
49+ expect (self .commit .author ).is_not_None ()
50+
51+ def test_committer (self ):
52+ expect (self .commit .author ).is_not_None ()
53+
54+ def test_tree (self ):
55+ expect (self .commit .tree ).isinstance (Tree )
56+
57+ def test_message (self ):
58+ expect_str (self .commit .message )
59+
60+ def test_parents (self ):
61+ expect (self .commit .parents ).isinstance (list )
62+ self .expect_list_of_class (self .commit .parents , dict )
63+
64+ def test_sha (self ):
65+ expect_str (self .commit .sha )
4466
4567
4668class TestTag (BaseTest ):
@@ -74,6 +96,8 @@ def __init__(self, methodName='runTest'):
7496 super (TestTreeHash , self ).__init__ (methodName )
7597 r = self .g .repository (self .sigm , self .todo )
7698 self .tree = r .tree ('31e862095dffa60744f1ce16a431ea040381f053' )
99+ self .hashes = self .tree .tree
100+ self .hash = self .hashes [0 ]
77101
78102 def test_tree (self ):
79103 expect (self .tree ).isinstance (Tree )
@@ -86,10 +110,8 @@ def test_tree_recurse(self):
86110 expect (self .tree .recurse ()).isinstance (Tree )
87111
88112 def test_hash (self ):
89- self .hashes = self .tree .tree
90113 for h in self .hashes :
91114 expect (h ).isinstance (Hash )
92- self .hash = self .hashes [0 ]
93115
94116 def test_hash_mode (self ):
95117 expect_str (self .hash .mode )
0 commit comments