Acknowledge lack of test coverage in the old Download API

This commit is contained in:
Vincent Jacques
2013-11-10 15:57:08 -08:00
parent 22f366b540
commit 5692c1ebb2
2 changed files with 15 additions and 13 deletions
+4 -2
View File
@@ -154,8 +154,10 @@ class GithubObject(object):
@staticmethod
def _makeDatetimeAttribute(value):
def parseDatetime(s):
if len(s) == 24:
return datetime.datetime.strptime(s, "%Y-%m-%dT%H:%M:%S.000Z")
if len(s) == 24: # pragma no branch (This branch was used only when creating a download)
# The Downloads API has been removed. I'm keeping this branch because I have no mean
# to check if it's really useless now.
return datetime.datetime.strptime(s, "%Y-%m-%dT%H:%M:%S.000Z") # pragma no cover (This branch was used only when creating a download)
elif len(s) == 25:
return datetime.datetime.strptime(s[:19], "%Y-%m-%dT%H:%M:%S") + (1 if s[19] == '-' else -1) * datetime.timedelta(hours=int(s[20:22]), minutes=int(s[23:25]))
else: