Skip to content

Commit 3f60faf

Browse files
committed
Use nose.tools.eq_ instead of assert_equals.
1 parent 862d522 commit 3f60faf

12 files changed

Lines changed: 473 additions & 516 deletions

tests/test_charset_header.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,16 @@
33
# This file is part of python-github2, and is made available under the 3-clause
44
# BSD license. See LICENSE for the full details.
55

6-
from nose.tools import assert_equals
6+
from nose.tools import eq_
77

88
from github2.request import charset_from_headers
99

1010

1111
def no_match_test():
1212
d = {}
13-
assert_equals("ascii", charset_from_headers(d))
13+
eq_("ascii", charset_from_headers(d))
1414

1515

1616
def utf_test():
1717
d = {'content-type': 'application/json; charset=utf-8'}
18-
assert_equals("utf-8", charset_from_headers(d))
18+
eq_("utf-8", charset_from_headers(d))

tests/test_commits.py

Lines changed: 27 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from datetime import datetime
77

8-
from nose.tools import assert_equals
8+
from nose.tools import eq_
99

1010
import 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

4340
class 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

Comments
 (0)