Skip to content

Commit 38098d3

Browse files
committed
These should pass now.
1 parent 2c9e3ee commit 38098d3

5 files changed

Lines changed: 13 additions & 8 deletions

File tree

github3/decorators.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,16 @@
66
77
"""
88

9-
from StringIO import StringIO
109
from functools import wraps
1110
from requests.models import Response
1211

12+
try:
13+
# python2
14+
from StringIO import StringIO
15+
except ImportError:
16+
# python3
17+
from io import StringIO
18+
1319

1420
def requires_auth(func):
1521
"""Decorator to note which object methods require authorization."""

github3/git.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def __init__(self, commit, session=None):
6161
#: dict containing at least the name, email and date the commit was
6262
# created
6363
self.author = commit.get('author')
64-
self._author_name = commit.get('author')
64+
self._author_name = self.author['name']
6565

6666
#: dict containing similar information to the author attribute
6767
self.committer = commit.get('committer')
@@ -74,7 +74,7 @@ def __init__(self, commit, session=None):
7474
self.tree = Tree(commit.get('tree'), self._session)
7575

7676
def __repr__(self):
77-
return '<Commit [{0}:{1}]>'.format(self.author.name, self.sha)
77+
return '<Commit [{0}:{1}]>'.format(self._author_name, self.sha)
7878

7979
def author_as_User(self):
8080
"""Attempt to return the author attribute as a

tests/test_api.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
from . import base
21
import github3
3-
from base import expect
2+
from .base import expect, BaseTest
43

54

6-
class TestAPI(base.BaseTest):
5+
class TestAPI(BaseTest):
76
def test_gist(self):
87
expect(github3.gist(3156487)).isinstance(github3.gists.Gist)
98

tests/test_repos.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ def test_zipball_url(self):
613613

614614
def __test_files__(fd, sha):
615615
expect(fd['additions']) >= 0
616-
expect(fd['deleteions']) >= 0
616+
expect(fd['deletions']) >= 0
617617
expect(fd['changes']) == fd['additions'] + fd['deletions']
618618
expect_str(fd['filename'])
619619
expect_str(fd['blob_url'])

unittests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ def load_test(test):
4040
join = '.'.join
4141
names = [join(['tests', f[:-3]]) for f in names if regex.match(f)]
4242
result = pool.map_async(load_test, names)
43-
suites = result.get(timeout=(5 * 60)) # 5 minutes
43+
suites = result.get(timeout=(10 * 60)) # 10 minutes
4444
suite = suites.pop(0)
4545
for s in suites:
4646
suite.addTests(s._tests)

0 commit comments

Comments
 (0)