55
66from datetime import datetime
77
8- from nose .tools import assert_equals
8+ from nose .tools import eq_
99
1010import utils
1111
@@ -16,61 +16,53 @@ class CommitProperties(utils.HttpMockTestCase):
1616
1717 def test_commit (self ):
1818 commit = self .client .commits .show ('ask/python-github2' , self .commit_id )
19- assert_equals (commit .message ,
20- 'Added cache support to manage_collaborators.' )
21- assert_equals (commit .parents ,
22- [{"id" : '7d1c855d2f44a55e4b90b40017be697cf70cb4a0' }])
23- assert_equals (commit .url ,
24- '/ask/python-github2/commit/%s' % self .commit_id )
25- assert_equals (commit .author ['login' ], 'JNRowe' )
26- assert_equals (commit .id , self .commit_id )
27- assert_equals (commit .committed_date ,
28- datetime (2011 , 6 , 6 , 16 , 13 , 50 ))
29- assert_equals (commit .authored_date , datetime (2011 , 6 , 6 , 16 , 13 , 50 ))
30- assert_equals (commit .tree , 'f48fcc1a0b8ea97f3147dc42cf7cdb6683493e94' )
31- assert_equals (commit .committer ['login' ], 'JNRowe' )
32- assert_equals (commit .added , None )
33- assert_equals (commit .removed , None )
34- assert_equals (commit .modified [0 ]['filename' ],
35- 'github2/bin/manage_collaborators.py' )
19+ eq_ (commit .message , 'Added cache support to manage_collaborators.' )
20+ eq_ (commit .parents ,
21+ [{"id" : '7d1c855d2f44a55e4b90b40017be697cf70cb4a0' }])
22+ eq_ (commit .url , '/ask/python-github2/commit/%s' % self .commit_id )
23+ eq_ (commit .author ['login' ], 'JNRowe' )
24+ eq_ (commit .id , self .commit_id )
25+ eq_ (commit .committed_date , datetime (2011 , 6 , 6 , 16 , 13 , 50 ))
26+ eq_ (commit .authored_date , datetime (2011 , 6 , 6 , 16 , 13 , 50 ))
27+ eq_ (commit .tree , 'f48fcc1a0b8ea97f3147dc42cf7cdb6683493e94' )
28+ eq_ (commit .committer ['login' ], 'JNRowe' )
29+ eq_ (commit .added , None )
30+ eq_ (commit .removed , None )
31+ eq_ (commit .modified [0 ]['filename' ],
32+ 'github2/bin/manage_collaborators.py' )
3633
3734 def test_repr (self ):
3835 commit = self .client .commits .show ('ask/python-github2' , self .commit_id )
39- assert_equals (repr (commit ),
40- '<Commit: %s Added cache suppo...>' % self .commit_id [:8 ])
36+ eq_ (repr (commit ),
37+ '<Commit: %s Added cache suppo...>' % self .commit_id [:8 ])
4138
4239
4340class CommitsQueries (utils .HttpMockTestCase ):
4441 """Test commit querying"""
4542
4643 def test_list (self ):
4744 commits = self .client .commits .list ('JNRowe/misc-overlay' )
48- assert_equals (len (commits ), 35 )
49- assert_equals (commits [0 ].id ,
50- '4de0834d58b37ef3020c49df43c95649217a2def' )
45+ eq_ (len (commits ), 35 )
46+ eq_ (commits [0 ].id , '4de0834d58b37ef3020c49df43c95649217a2def' )
5147
5248 def test_list_with_page (self ):
5349 commits = self .client .commits .list ('JNRowe/jnrowe-misc' , page = 2 )
54- assert_equals (len (commits ), 35 )
55- assert_equals (commits [0 ].id ,
56- '1f5ad2c3206bafc4aca9e6ce50f5c605befdb3d6' )
50+ eq_ (len (commits ), 35 )
51+ eq_ (commits [0 ].id , '1f5ad2c3206bafc4aca9e6ce50f5c605befdb3d6' )
5752
5853 def test_list_with_branch (self ):
5954 commits = self .client .commits .list ('JNRowe/misc-overlay' , 'gh-pages' )
60- assert_equals (len (commits ), 35 )
61- assert_equals (commits [0 ].id ,
62- '025148bdaa6fb6bdac9c3522d481fadf1c0a456f' )
55+ eq_ (len (commits ), 35 )
56+ eq_ (commits [0 ].id , '025148bdaa6fb6bdac9c3522d481fadf1c0a456f' )
6357
6458 def test_list_with_file (self ):
6559 commits = self .client .commits .list ('JNRowe/misc-overlay' ,
6660 file = 'Makefile' )
67- assert_equals (len (commits ), 35 )
68- assert_equals (commits [0 ].id ,
69- 'fc12b924d34dc38c8ce76d27a866221faa88cb72' )
61+ eq_ (len (commits ), 35 )
62+ eq_ (commits [0 ].id , 'fc12b924d34dc38c8ce76d27a866221faa88cb72' )
7063
7164 def test_list_with_branch_and_file (self ):
7265 commits = self .client .commits .list ('JNRowe/misc-overlay' , 'gh-pages' ,
7366 'packages/dev-python.html' )
74- assert_equals (len (commits ), 35 )
75- assert_equals (commits [0 ].id ,
76- '025148bdaa6fb6bdac9c3522d481fadf1c0a456f' )
67+ eq_ (len (commits ), 35 )
68+ eq_ (commits [0 ].id , '025148bdaa6fb6bdac9c3522d481fadf1c0a456f' )
0 commit comments