From 1e8dda73db02908a9529a2dfed3b466ac952e6d7 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 17 Feb 2013 13:53:13 +0100 Subject: [PATCH] Fix pep8 and coverage --- github/GithubObject.py | 2 +- github/Repository.py | 2 +- github/tests/Issue140.py | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/github/GithubObject.py b/github/GithubObject.py index f99a2e05..26b4c283 100644 --- a/github/GithubObject.py +++ b/github/GithubObject.py @@ -20,7 +20,7 @@ import GithubException class _NotSetType: def __repr__(self): - return "NotSet" + return "NotSet" # pragma no cover NotSet = _NotSetType() diff --git a/github/Repository.py b/github/Repository.py index 86a6cb32..19518926 100644 --- a/github/Repository.py +++ b/github/Repository.py @@ -889,7 +889,7 @@ class Repository(github.GithubObject.GithubObject): None ) return [ - github.ContentFile.ContentFile(self._requester, attributes, completed=attributes["type"]!="file") # Lazy completion only makes sense for files. See discussion here: https://github.com/jacquev6/PyGithub/issues/140#issuecomment-13481130 + github.ContentFile.ContentFile(self._requester, attributes, completed=(attributes["type"] != "file")) # Lazy completion only makes sense for files. See discussion here: https://github.com/jacquev6/PyGithub/issues/140#issuecomment-13481130 for attributes in data ] diff --git a/github/tests/Issue140.py b/github/tests/Issue140.py index 78a05bb1..f051cd07 100644 --- a/github/tests/Issue140.py +++ b/github/tests/Issue140.py @@ -38,4 +38,8 @@ class Issue140(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issu def testGetFileContents(self): contents = self.repo.get_file_contents("/js/bootstrap-affix.js") self.assertEqual(contents.encoding, "base64") + self.assertEqual(contents.url, "https://api.github.com/repos/twitter/bootstrap/contents/js/bootstrap-affix.js") self.assertEqual(len(contents.content), 4722) + + def testGetDirContentsWithRef(self): + contents = self.repo.get_dir_contents("/js", "")