Skip to content

Commit e639f3f

Browse files
committed
Actually fix python3 tests.
The encode call will work in both python2 and python3.
1 parent 76db50e commit e639f3f

2 files changed

Lines changed: 2 additions & 5 deletions

File tree

github3/git.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,7 @@ class Blob(GitHubObject):
1717
def __init__(self, blob):
1818
super(Blob, self).__init__(blob)
1919
self._api = blob.get('url')
20-
self._content = blob.get('content')
21-
if isinstance(self._content, bytes):
22-
self._content = self._content.decode('utf-8')
20+
self._content = blob.get('content').encode()
2321
self._enc = blob.get('encoding')
2422
if self._enc == 'base64':
2523
self._decoded = b64decode(self._content)

tests/test_gist.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ def test_gists(self):
1515
expect(g.list_files()).isinstance(list)
1616
expect(g.forks) >= 0
1717
self.assertAreNotNone(g, 'created_at', 'description',
18-
'git_pull_url', 'git_push_url', 'html_url')
19-
expect(g.id) >= 1
18+
'git_pull_url', 'git_push_url', 'html_url', 'id')
2019
expect(g.is_public()).isinstance(bool)
2120
expect(g.is_starred()).isinstance(bool)
2221
expect(g.to_json()).isinstance(dict)

0 commit comments

Comments
 (0)