@@ -442,3 +442,43 @@ def test_tarball_url(self):
442
442
443
443
def test_zipball_url (self ):
444
444
expect (self .tag .zipball_url ).isinstance (base .str_test )
445
+
446
+
447
+ class TestRepoCommit (base .BaseTest ):
448
+ def __init__ (self , methodName = 'runTest' ):
449
+ super (TestRepoCommit , self ).__init__ (methodName )
450
+ repo = self .g .repository (self .sigm , self .todo )
451
+ self .commit = repo .commit ('04d55444a3ec06ca8d2aa0a5e333cdaf27113254' )
452
+ self .sha = self .commit .sha
453
+
454
+ def test_additions (self ):
455
+ expect (self .commit .additions ) == 12
456
+
457
+ def test_author (self ):
458
+ expect (self .commit .author ).isinstance (User )
459
+
460
+ def test_commit (self ):
461
+ expect (self .commit .commit ).isinstance (Commit )
462
+
463
+ def test_committer (self ):
464
+ expect (self .commit .committer ).isinstance (User )
465
+
466
+ def test_deletions (self ):
467
+ expect (self .commit .deletions ) == 5
468
+
469
+ def test_files (self ):
470
+ expect (self .commit .files ).isinstance (list )
471
+ expect (self .commit .files ) > []
472
+ for file in self .commit .files :
473
+ expect (file .additions ) > 0
474
+ expect (file .deletions ) > 0
475
+ expect (file .changes ) == file .additions + file .deletions
476
+ expect (file .filename ).isinstance (base .str_test )
477
+ expect (file .blob_url ).isinstance (base .str_test )
478
+ expect (file .raw_url ).isinstance (base .str_test )
479
+ expect (file .sha ) == self .sha
480
+ expect (file .status ) == 'modified'
481
+ expect (file .patch ).isinstance (base .str_test )
482
+
483
+ def test_total (self ):
484
+ expect (self .commit .total ) == 17
0 commit comments