From 76f05598f433d276677f3583a7db23a2105414dc Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sat, 2 Jun 2012 08:28:34 +0100 Subject: [PATCH] Use datetime where it makes sence (issue #41) --- .../description.human_readable.json | 74 +++++++++---------- .../description.normalized.json | 74 +++++++++---------- .../JsonDescriptionOfGithubApiV3/normalize.py | 2 +- codegen/generate.py | 2 + .../GithubObject.AttributeValue.simple.py | 2 +- .../templates/GithubObject.IsInstance.date.py | 1 + .../GithubObject.IsInstance.datetime.py | 1 + codegen/templates/GithubObject.py | 5 ++ doc/ReferenceOfClasses.md | 74 +++++++++---------- src/github/AuthenticatedUser.py | 4 +- src/github/Authorization.py | 6 +- src/github/CommitComment.py | 6 +- src/github/Download.py | 6 +- src/github/Event.py | 4 +- src/github/Gist.py | 6 +- src/github/GistComment.py | 6 +- src/github/GistHistoryState.py | 4 +- src/github/Hook.py | 6 +- src/github/Issue.py | 8 +- src/github/IssueComment.py | 6 +- src/github/IssueEvent.py | 4 +- src/github/Milestone.py | 10 ++- src/github/NamedUser.py | 4 +- src/github/Organization.py | 4 +- src/github/PullRequest.py | 10 ++- src/github/PullRequestComment.py | 6 +- src/github/Repository.py | 15 ++-- test/AuthenticatedUser.py | 3 +- test/Authorization.py | 6 +- test/CommitComment.py | 6 +- test/Download.py | 4 +- test/Event.py | 4 +- test/Gist.py | 11 +-- test/GistComment.py | 8 +- test/Hook.py | 8 +- test/Issue.py | 8 +- test/IssueComment.py | 8 +- test/IssueEvent.py | 4 +- test/Milestone.py | 10 ++- test/NamedUser.py | 5 +- test/Organization.py | 4 +- test/PullRequest.py | 10 ++- test/PullRequestComment.py | 6 +- test/Repository.py | 15 ++-- 44 files changed, 272 insertions(+), 198 deletions(-) create mode 100644 codegen/templates/GithubObject.IsInstance.date.py create mode 100644 codegen/templates/GithubObject.IsInstance.datetime.py diff --git a/codegen/JsonDescriptionOfGithubApiV3/description.human_readable.json b/codegen/JsonDescriptionOfGithubApiV3/description.human_readable.json index 2ad51df7..295ae6ac 100644 --- a/codegen/JsonDescriptionOfGithubApiV3/description.human_readable.json +++ b/codegen/JsonDescriptionOfGithubApiV3/description.human_readable.json @@ -31,7 +31,7 @@ { "name": "blog", "type": "string" }, { "name": "collaborators", "type": "integer" }, { "name": "company", "type": "string" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "disk_usage", "type": "integer" }, { "name": "email", "type": "string" }, { "name": "followers", "type": "integer" }, @@ -266,13 +266,13 @@ "delete": true, "attributes": [ { "name": "app", "type": "AuthorizationApplication" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "id", "type": "integer" }, { "name": "note_url", "type": "string" }, { "name": "note", "type": "string" }, { "name": "scopes", "type": "list:string" }, { "name": "token", "type": "string" }, - { "name": "updated_at", "type": "string" }, + { "name": "updated_at", "type": "datetime" }, { "name": "url", "type": "string" } ] }, @@ -350,13 +350,13 @@ "attributes": [ { "name": "body", "type": "string" }, { "name": "commit_id", "type": "string" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "html_url", "type": "string" }, { "name": "id", "type": "integer" }, { "name": "line", "type": "integer" }, { "name": "path", "type": "string" }, { "name": "position", "type": "integer" }, - { "name": "updated_at", "type": "string" }, + { "name": "updated_at", "type": "datetime" }, { "name": "url", "type": "string" }, { "name": "user", "type": "NamedUser" } ] @@ -369,10 +369,10 @@ { "name": "acl", "type": "string" }, { "name": "bucket", "type": "string" }, { "name": "content_type", "type": "string" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "description", "type": "string" }, { "name": "download_count", "type": "integer" }, - { "name": "expirationdate", "type": "string" }, + { "name": "expirationdate", "type": "datetime" }, { "name": "html_url", "type": "string" }, { "name": "id", "type": "integer" }, { "name": "mime_type", "type": "string" }, @@ -391,7 +391,7 @@ "name": "Event", "attributes": [ { "name": "actor", "type": "NamedUser" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "id", "type": "string" }, { "name": "payload", "type": "dict" }, { "name": "public", "type": "bool" }, @@ -404,7 +404,7 @@ "name": "GistHistoryState", "attributes": [ { "name": "change_status", "type": "CommitStats" }, - { "name": "committed_at", "type": "string" }, + { "name": "committed_at", "type": "datetime" }, { "name": "url", "type": "string" }, { "name": "user", "type": "NamedUser" }, { "name": "version", "type": "string" } @@ -431,7 +431,7 @@ "delete": true, "attributes": [ { "name": "comments", "type": "integer" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "description", "type": "string" }, { "name": "files", "type": "dict:string-GistFile" }, { "name": "fork_of", "type": "Gist" }, @@ -442,7 +442,7 @@ { "name": "html_url", "type": "string" }, { "name": "id", "type": "string" }, { "name": "public", "type": "bool" }, - { "name": "updated_at", "type": "string" }, + { "name": "updated_at", "type": "datetime" }, { "name": "url", "type": "string" }, { "name": "user", "type": "NamedUser" } ], @@ -531,9 +531,9 @@ "delete": true, "attributes": [ { "name": "body", "type": "string" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "id", "type": "integer" }, - { "name": "updated_at", "type": "string" }, + { "name": "updated_at", "type": "datetime" }, { "name": "url", "type": "string" }, { "name": "user", "type": "NamedUser" } ] @@ -657,12 +657,12 @@ "attributes": [ { "name": "active", "type": "bool" }, { "name": "config", "type": "dict" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "events", "type": "list:string" }, { "name": "id", "type": "integer" }, { "name": "last_response", "type": "HookResponse" }, { "name": "name", "type": "string" }, - { "name": "updated_at", "type": "string" }, + { "name": "updated_at", "type": "datetime" }, { "name": "url", "type": "string" } ], "additionalMethods": [ @@ -704,10 +704,10 @@ "attributes": [ { "name": "assignee", "type": "NamedUser" }, { "name": "body", "type": "string" }, - { "name": "closed_at", "type": "string" }, + { "name": "closed_at", "type": "datetime" }, { "name": "closed_by", "type": "NamedUser" }, { "name": "comments", "type": "integer" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "html_url", "type": "string" }, { "name": "id", "type": "integer" }, { "name": "labels", "type": "list:Label" }, @@ -717,7 +717,7 @@ { "name": "repository", "type": "Repository" }, { "name": "state", "type": "string" }, { "name": "title", "type": "string" }, - { "name": "updated_at", "type": "string" }, + { "name": "updated_at", "type": "datetime" }, { "name": "url", "type": "string" }, { "name": "user", "type": "NamedUser" } ], @@ -780,9 +780,9 @@ "delete": true, "attributes": [ { "name": "body", "type": "string" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "id", "type": "integer" }, - { "name": "updated_at", "type": "string" }, + { "name": "updated_at", "type": "datetime" }, { "name": "url", "type": "string" }, { "name": "user", "type": "NamedUser" } ] @@ -791,7 +791,7 @@ "name": "IssueEvent", "attributes": [ { "name": "commit_id", "type": "string" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "event", "type": "string" }, { "name": "id", "type": "integer" }, { "name": "issue", "type": "Issue" }, @@ -831,15 +831,15 @@ "optionalParameters": [ { "name": "state", "type": "string" }, { "name": "description", "type": "string" }, - { "name": "due_on", "type": "string" } + { "name": "due_on", "type": "date" } ] }, "delete": true, "attributes": [ { "name": "closed_issues", "type": "integer" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "description", "type": "string" }, - { "name": "due_on", "type": "string" }, + { "name": "due_on", "type": "datetime" }, { "name": "id", "type": "integer" }, { "name": "number", "type": "integer" }, { "name": "open_issues", "type": "integer" }, @@ -869,7 +869,7 @@ { "name": "collaborators", "type": "integer" }, { "name": "company", "type": "string" }, { "name": "contributions", "type": "integer" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "disk_usage", "type": "integer" }, { "name": "email", "type": "string" }, { "name": "followers", "type": "integer" }, @@ -1014,7 +1014,7 @@ { "name": "blog", "type": "string" }, { "name": "collaborators", "type": "integer" }, { "name": "company", "type": "string" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "disk_usage", "type": "integer" }, { "name": "email", "type": "string" }, { "name": "followers", "type": "integer" }, @@ -1171,10 +1171,10 @@ { "name": "base", "type": "PullRequestPart" }, { "name": "body", "type": "string" }, { "name": "changed_files", "type": "integer" }, - { "name": "closed_at", "type": "string" }, + { "name": "closed_at", "type": "datetime" }, { "name": "comments", "type": "integer" }, { "name": "commits", "type": "integer" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "deletions", "type": "integer" }, { "name": "diff_url", "type": "string" }, { "name": "head", "type": "PullRequestPart" }, @@ -1182,7 +1182,7 @@ { "name": "id", "type": "integer" }, { "name": "issue_url", "type": "string" }, { "name": "mergeable", "type": "bool" }, - { "name": "merged_at", "type": "string" }, + { "name": "merged_at", "type": "datetime" }, { "name": "merged_by", "type": "NamedUser" }, { "name": "merged", "type": "bool" }, { "name": "number", "type": "integer" }, @@ -1190,7 +1190,7 @@ { "name": "review_comments", "type": "integer" }, { "name": "state", "type": "string" }, { "name": "title", "type": "string" }, - { "name": "updated_at", "type": "string" }, + { "name": "updated_at", "type": "datetime" }, { "name": "url", "type": "string" }, { "name": "user", "type": "NamedUser" } ], @@ -1282,13 +1282,13 @@ "attributes": [ { "name": "body", "type": "string" }, { "name": "commit_id", "type": "string" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "id", "type": "integer" }, { "name": "path", "type": "string" }, { "name": "position", "type": "integer" }, { "name": "original_position", "type": "integer" }, { "name": "original_commit_id", "type": "string" }, - { "name": "updated_at", "type": "string" }, + { "name": "updated_at", "type": "datetime" }, { "name": "url", "type": "string" }, { "name": "user", "type": "NamedUser" } ] @@ -1340,7 +1340,7 @@ }, "attributes": [ { "name": "clone_url", "type": "string" }, - { "name": "created_at", "type": "string" }, + { "name": "created_at", "type": "datetime" }, { "name": "description", "type": "string" }, { "name": "fork", "type": "bool" }, { "name": "forks", "type": "integer" }, @@ -1361,12 +1361,12 @@ { "name": "parent", "type": "Repository" }, { "name": "permissions", "type": "Permissions" }, { "name": "private", "type": "bool" }, - { "name": "pushed_at", "type": "string" }, + { "name": "pushed_at", "type": "datetime" }, { "name": "size", "type": "integer" }, { "name": "source", "type": "Repository" }, { "name": "ssh_url", "type": "string" }, { "name": "svn_url", "type": "string" }, - { "name": "updated_at", "type": "string" }, + { "name": "updated_at", "type": "datetime" }, { "name": "url", "type": "string" }, { "name": "watchers", "type": "integer" } ], @@ -1591,7 +1591,7 @@ { "name": "labels", "type": "list:Label" }, { "name": "sort", "type": "string" }, { "name": "direction", "type": "string" }, - { "name": "since", "type": "string" } + { "name": "since", "type": "datetime" } ] }, "createElement": { @@ -1682,7 +1682,7 @@ "optionalParameters": [ { "name": "state", "type": "string" }, { "name": "description", "type": "string" }, - { "name": "due_on", "type": "string" } + { "name": "due_on", "type": "date" } ] }, "getElement": { diff --git a/codegen/JsonDescriptionOfGithubApiV3/description.normalized.json b/codegen/JsonDescriptionOfGithubApiV3/description.normalized.json index 067019d4..ba1c67d9 100644 --- a/codegen/JsonDescriptionOfGithubApiV3/description.normalized.json +++ b/codegen/JsonDescriptionOfGithubApiV3/description.normalized.json @@ -46,7 +46,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -1416,7 +1416,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -1464,7 +1464,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "updated_at" }, @@ -1821,7 +1821,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -1869,7 +1869,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "updated_at" }, @@ -2129,7 +2129,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -2153,7 +2153,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "expirationdate" }, @@ -2299,7 +2299,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -2449,7 +2449,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -2538,7 +2538,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "updated_at" }, @@ -2885,7 +2885,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -2901,7 +2901,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "updated_at" }, @@ -3050,7 +3050,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "committed_at" }, @@ -3537,7 +3537,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -3577,7 +3577,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "updated_at" }, @@ -3781,7 +3781,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "closed_at" }, @@ -3805,7 +3805,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -3885,7 +3885,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "updated_at" }, @@ -4353,7 +4353,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -4369,7 +4369,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "updated_at" }, @@ -4479,7 +4479,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -4680,7 +4680,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -4704,7 +4704,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "due_on" }, @@ -4818,7 +4818,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "date" }, "name": "due_on" } @@ -4942,7 +4942,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -5587,7 +5587,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -6640,7 +6640,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "closed_at" }, @@ -6664,7 +6664,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -6736,7 +6736,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "merged_at" }, @@ -6792,7 +6792,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "updated_at" }, @@ -7172,7 +7172,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -7220,7 +7220,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "updated_at" }, @@ -7400,7 +7400,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "created_at" }, @@ -7568,7 +7568,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "pushed_at" }, @@ -7608,7 +7608,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "updated_at" }, @@ -9260,7 +9260,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "datetime" }, "name": "since" } @@ -9660,7 +9660,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "string" + "name": "date" }, "name": "due_on" } diff --git a/codegen/JsonDescriptionOfGithubApiV3/normalize.py b/codegen/JsonDescriptionOfGithubApiV3/normalize.py index c1abcdeb..49450764 100644 --- a/codegen/JsonDescriptionOfGithubApiV3/normalize.py +++ b/codegen/JsonDescriptionOfGithubApiV3/normalize.py @@ -32,7 +32,7 @@ class Type: json = { "cardinality": self.cardinality, "name": self.name, - "simple": self.name in [ "void", "string", "integer", "bool", "float", "dict" ], + "simple": self.name in [ "void", "string", "integer", "bool", "float", "dict", "datetime", "date" ], } if self.keyName is not None: json[ "key_name" ] = self.keyName diff --git a/codegen/generate.py b/codegen/generate.py index 2898a785..1c133dbe 100644 --- a/codegen/generate.py +++ b/codegen/generate.py @@ -36,6 +36,8 @@ for class_ in description[ "classes" ]: for attribute in class_[ "attributes" ]: if not attribute[ "type" ][ "simple" ]: dependencies.add( attribute[ "type" ][ "name" ] ) + if attribute[ "type" ][ "name" ] == "datetime": + class_[ "needsDatetime" ] = True class_[ "dependencies" ] = list( dependencies ) class_[ "needsUrllib" ] = class_[ "name" ] in [ "Label", "Repository" ] diff --git a/codegen/templates/GithubObject.AttributeValue.simple.py b/codegen/templates/GithubObject.AttributeValue.simple.py index 3a709457..ef252328 100644 --- a/codegen/templates/GithubObject.AttributeValue.simple.py +++ b/codegen/templates/GithubObject.AttributeValue.simple.py @@ -1 +1 @@ -attributes[ "{{ attribute.name }}" ] \ No newline at end of file +{% if attribute.type.name == "datetime" %}None if attributes[ "{{ attribute.name }}" ] is None else datetime.datetime.strptime( attributes[ "{{ attribute.name }}" ], "%Y-%m-%dT%H:%M:%SZ" ){% else %}attributes[ "{{ attribute.name }}" ]{% endif %} \ No newline at end of file diff --git a/codegen/templates/GithubObject.IsInstance.date.py b/codegen/templates/GithubObject.IsInstance.date.py new file mode 100644 index 00000000..daaedcb1 --- /dev/null +++ b/codegen/templates/GithubObject.IsInstance.date.py @@ -0,0 +1 @@ +{% include "GithubObject.IsInstance.py" with variable=variable type="datetime.date" only %} \ No newline at end of file diff --git a/codegen/templates/GithubObject.IsInstance.datetime.py b/codegen/templates/GithubObject.IsInstance.datetime.py new file mode 100644 index 00000000..7fbdf970 --- /dev/null +++ b/codegen/templates/GithubObject.IsInstance.datetime.py @@ -0,0 +1 @@ +{% include "GithubObject.IsInstance.py" with variable=variable type="( str, unicode )" only %} \ No newline at end of file diff --git a/codegen/templates/GithubObject.py b/codegen/templates/GithubObject.py index 18ab33f4..0964f049 100644 --- a/codegen/templates/GithubObject.py +++ b/codegen/templates/GithubObject.py @@ -1,5 +1,10 @@ {% if class.needsUrllib %} import urllib +{% endif %} +{% if class.needsDatetime %} +import datetime +{% endif %} +{% if class.needsUrllib or class.needsDatetime %} ########## {% endif %} diff --git a/doc/ReferenceOfClasses.md b/doc/ReferenceOfClasses.md index 650e5d6c..78b59449 100644 --- a/doc/ReferenceOfClasses.md +++ b/doc/ReferenceOfClasses.md @@ -20,7 +20,7 @@ Attributes * `blog`: string * `collaborators`: integer * `company`: string -* `created_at`: string +* `created_at`: datetime * `disk_usage`: integer * `email`: string * `followers`: integer @@ -154,13 +154,13 @@ Class `Authorization` Attributes ---------- * `app`: `AuthorizationApplication` -* `created_at`: string +* `created_at`: datetime * `id`: integer * `note`: string * `note_url`: string * `scopes`: list of string * `token`: string -* `updated_at`: string +* `updated_at`: datetime * `url`: string Deletion @@ -222,13 +222,13 @@ Attributes ---------- * `body`: string * `commit_id`: string -* `created_at`: string +* `created_at`: datetime * `html_url`: string * `id`: integer * `line`: integer * `path`: string * `position`: integer -* `updated_at`: string +* `updated_at`: datetime * `url`: string * `user`: `NamedUser` @@ -277,10 +277,10 @@ Attributes * `acl`: string * `bucket`: string * `content_type`: string -* `created_at`: string +* `created_at`: datetime * `description`: string * `download_count`: integer -* `expirationdate`: string +* `expirationdate`: datetime * `html_url`: string * `id`: integer * `mime_type`: string @@ -304,7 +304,7 @@ Class `Event` Attributes ---------- * `actor`: `NamedUser` -* `created_at`: string +* `created_at`: datetime * `id`: string * `org`: `Organization` * `payload`: dict @@ -333,7 +333,7 @@ Class `Gist` Attributes ---------- * `comments`: integer -* `created_at`: string +* `created_at`: datetime * `description`: string * `files`: dict of string to `GistFile` * `fork_of`: `Gist` @@ -344,7 +344,7 @@ Attributes * `html_url`: string * `id`: string * `public`: bool -* `updated_at`: string +* `updated_at`: datetime * `url`: string * `user`: `NamedUser` @@ -382,9 +382,9 @@ Class `GistComment` Attributes ---------- * `body`: string -* `created_at`: string +* `created_at`: datetime * `id`: integer -* `updated_at`: string +* `updated_at`: datetime * `url`: string * `user`: `NamedUser` @@ -414,7 +414,7 @@ Class `GistHistoryState` Attributes ---------- * `change_status`: `CommitStats` -* `committed_at`: string +* `committed_at`: datetime * `url`: string * `user`: `NamedUser` * `version`: string @@ -520,12 +520,12 @@ Attributes ---------- * `active`: bool * `config`: dict -* `created_at`: string +* `created_at`: datetime * `events`: list of string * `id`: integer * `last_response`: `HookResponse` * `name`: string -* `updated_at`: string +* `updated_at`: datetime * `url`: string Deletion @@ -562,10 +562,10 @@ Attributes ---------- * `assignee`: `NamedUser` * `body`: string -* `closed_at`: string +* `closed_at`: datetime * `closed_by`: `NamedUser` * `comments`: integer -* `created_at`: string +* `created_at`: datetime * `html_url`: string * `id`: integer * `labels`: list of `Label` @@ -575,7 +575,7 @@ Attributes * `repository`: `Repository` * `state`: string * `title`: string -* `updated_at`: string +* `updated_at`: datetime * `url`: string * `user`: `NamedUser` @@ -618,9 +618,9 @@ Class `IssueComment` Attributes ---------- * `body`: string -* `created_at`: string +* `created_at`: datetime * `id`: integer -* `updated_at`: string +* `updated_at`: datetime * `url`: string * `user`: `NamedUser` @@ -640,7 +640,7 @@ Attributes ---------- * `actor`: `NamedUser` * `commit_id`: string -* `created_at`: string +* `created_at`: datetime * `event`: string * `id`: integer * `issue`: `Issue` @@ -680,10 +680,10 @@ Class `Milestone` Attributes ---------- * `closed_issues`: integer -* `created_at`: string +* `created_at`: datetime * `creator`: `NamedUser` * `description`: string -* `due_on`: string +* `due_on`: datetime * `id`: integer * `number`: integer * `open_issues`: integer @@ -705,7 +705,7 @@ Modification * `title`: string * `state`: string * `description`: string - * `due_on`: string + * `due_on`: date Class `NamedUser` ================= @@ -718,7 +718,7 @@ Attributes * `collaborators`: integer * `company`: string * `contributions`: integer -* `created_at`: string +* `created_at`: datetime * `disk_usage`: integer * `email`: string * `followers`: integer @@ -787,7 +787,7 @@ Attributes * `blog`: string * `collaborators`: integer * `company`: string -* `created_at`: string +* `created_at`: datetime * `disk_usage`: integer * `email`: string * `followers`: integer @@ -898,10 +898,10 @@ Attributes * `base`: `PullRequestPart` * `body`: string * `changed_files`: integer -* `closed_at`: string +* `closed_at`: datetime * `comments`: integer * `commits`: integer -* `created_at`: string +* `created_at`: datetime * `deletions`: integer * `diff_url`: string * `head`: `PullRequestPart` @@ -910,14 +910,14 @@ Attributes * `issue_url`: string * `mergeable`: bool * `merged`: bool -* `merged_at`: string +* `merged_at`: datetime * `merged_by`: `NamedUser` * `number`: integer * `patch_url`: string * `review_comments`: integer * `state`: string * `title`: string -* `updated_at`: string +* `updated_at`: datetime * `url`: string * `user`: `NamedUser` @@ -960,13 +960,13 @@ Attributes ---------- * `body`: string * `commit_id`: string -* `created_at`: string +* `created_at`: datetime * `id`: integer * `original_commit_id`: string * `original_position`: integer * `path`: string * `position`: integer -* `updated_at`: string +* `updated_at`: datetime * `url`: string * `user`: `NamedUser` @@ -1005,7 +1005,7 @@ Class `Repository` Attributes ---------- * `clone_url`: string -* `created_at`: string +* `created_at`: datetime * `description`: string * `fork`: bool * `forks`: integer @@ -1026,12 +1026,12 @@ Attributes * `parent`: `Repository` * `permissions`: `Permissions` * `private`: bool -* `pushed_at`: string +* `pushed_at`: datetime * `size`: integer * `source`: `Repository` * `ssh_url`: string * `svn_url`: string -* `updated_at`: string +* `updated_at`: datetime * `url`: string * `watchers`: integer @@ -1170,7 +1170,7 @@ Issues * `labels`: list of `Label` * `sort`: string * `direction`: string - * `since`: string + * `since`: datetime Issues_events ------------- @@ -1206,7 +1206,7 @@ Milestones * `title`: string * `state`: string * `description`: string - * `due_on`: string + * `due_on`: date * `get_milestone( number )`: `Milestone` * `number`: integer * `get_milestones( [state, sort, direction] )`: list of `Milestone` diff --git a/src/github/AuthenticatedUser.py b/src/github/AuthenticatedUser.py index 42a54d9d..5c987113 100644 --- a/src/github/AuthenticatedUser.py +++ b/src/github/AuthenticatedUser.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject import PaginatedList ########## @@ -632,7 +634,7 @@ class AuthenticatedUser( GithubObject.GithubObject ): self._company = attributes[ "company" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "disk_usage" in attributes: # pragma no branch assert attributes[ "disk_usage" ] is None or isinstance( attributes[ "disk_usage" ], int ), attributes[ "disk_usage" ] self._disk_usage = attributes[ "disk_usage" ] diff --git a/src/github/Authorization.py b/src/github/Authorization.py index 2498495e..7eacfe15 100644 --- a/src/github/Authorization.py +++ b/src/github/Authorization.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject ########## import AuthorizationApplication @@ -103,7 +105,7 @@ class Authorization( GithubObject.GithubObject ): self._app = None if attributes[ "app" ] is None else AuthorizationApplication.AuthorizationApplication( self._requester, attributes[ "app" ], completed = False ) if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "id" in attributes: # pragma no branch assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] self._id = attributes[ "id" ] @@ -121,7 +123,7 @@ class Authorization( GithubObject.GithubObject ): self._token = attributes[ "token" ] if "updated_at" in attributes: # pragma no branch assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = attributes[ "updated_at" ] + self._updated_at = None if attributes[ "updated_at" ] is None else datetime.datetime.strptime( attributes[ "updated_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "url" in attributes: # pragma no branch assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self._url = attributes[ "url" ] diff --git a/src/github/CommitComment.py b/src/github/CommitComment.py index 07bb2385..039e65ed 100644 --- a/src/github/CommitComment.py +++ b/src/github/CommitComment.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject ########## import NamedUser @@ -106,7 +108,7 @@ class CommitComment( GithubObject.GithubObject ): self._commit_id = attributes[ "commit_id" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "html_url" in attributes: # pragma no branch assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] self._html_url = attributes[ "html_url" ] @@ -124,7 +126,7 @@ class CommitComment( GithubObject.GithubObject ): self._position = attributes[ "position" ] if "updated_at" in attributes: # pragma no branch assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = attributes[ "updated_at" ] + self._updated_at = None if attributes[ "updated_at" ] is None else datetime.datetime.strptime( attributes[ "updated_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "url" in attributes: # pragma no branch assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self._url = attributes[ "url" ] diff --git a/src/github/Download.py b/src/github/Download.py index 6653fcb4..47e1e5ab 100644 --- a/src/github/Download.py +++ b/src/github/Download.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject class Download( GithubObject.GithubObject ): @@ -150,7 +152,7 @@ class Download( GithubObject.GithubObject ): self._content_type = attributes[ "content_type" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "description" in attributes: # pragma no branch assert attributes[ "description" ] is None or isinstance( attributes[ "description" ], ( str, unicode ) ), attributes[ "description" ] self._description = attributes[ "description" ] @@ -159,7 +161,7 @@ class Download( GithubObject.GithubObject ): self._download_count = attributes[ "download_count" ] if "expirationdate" in attributes: # pragma no branch assert attributes[ "expirationdate" ] is None or isinstance( attributes[ "expirationdate" ], ( str, unicode ) ), attributes[ "expirationdate" ] - self._expirationdate = attributes[ "expirationdate" ] + self._expirationdate = None if attributes[ "expirationdate" ] is None else datetime.datetime.strptime( attributes[ "expirationdate" ], "%Y-%m-%dT%H:%M:%S.000Z" ) if "html_url" in attributes: # pragma no branch assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] self._html_url = attributes[ "html_url" ] diff --git a/src/github/Event.py b/src/github/Event.py index 28df0d65..166133ce 100644 --- a/src/github/Event.py +++ b/src/github/Event.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject ########## import Organization @@ -56,7 +58,7 @@ class Event( GithubObject.BasicGithubObject ): self._actor = None if attributes[ "actor" ] is None else NamedUser.NamedUser( self._requester, attributes[ "actor" ], completed = False ) if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "id" in attributes: # pragma no branch assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], ( str, unicode ) ), attributes[ "id" ] self._id = attributes[ "id" ] diff --git a/src/github/Gist.py b/src/github/Gist.py index f22d26fd..3d344a9b 100644 --- a/src/github/Gist.py +++ b/src/github/Gist.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject import PaginatedList ########## @@ -213,7 +215,7 @@ class Gist( GithubObject.GithubObject ): self._comments = attributes[ "comments" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "description" in attributes: # pragma no branch assert attributes[ "description" ] is None or isinstance( attributes[ "description" ], ( str, unicode ) ), attributes[ "description" ] self._description = attributes[ "description" ] @@ -255,7 +257,7 @@ class Gist( GithubObject.GithubObject ): self._public = attributes[ "public" ] if "updated_at" in attributes: # pragma no branch assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = attributes[ "updated_at" ] + self._updated_at = None if attributes[ "updated_at" ] is None else datetime.datetime.strptime( attributes[ "updated_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "url" in attributes: # pragma no branch assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self._url = attributes[ "url" ] diff --git a/src/github/GistComment.py b/src/github/GistComment.py index 182b1716..1acd523a 100644 --- a/src/github/GistComment.py +++ b/src/github/GistComment.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject ########## import NamedUser @@ -73,13 +75,13 @@ class GistComment( GithubObject.GithubObject ): self._body = attributes[ "body" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "id" in attributes: # pragma no branch assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] self._id = attributes[ "id" ] if "updated_at" in attributes: # pragma no branch assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = attributes[ "updated_at" ] + self._updated_at = None if attributes[ "updated_at" ] is None else datetime.datetime.strptime( attributes[ "updated_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "url" in attributes: # pragma no branch assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self._url = attributes[ "url" ] diff --git a/src/github/GistHistoryState.py b/src/github/GistHistoryState.py index 95b8a9fb..62829785 100644 --- a/src/github/GistHistoryState.py +++ b/src/github/GistHistoryState.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject ########## import NamedUser @@ -45,7 +47,7 @@ class GistHistoryState( GithubObject.GithubObject ): self._change_status = None if attributes[ "change_status" ] is None else CommitStats.CommitStats( self._requester, attributes[ "change_status" ], completed = False ) if "committed_at" in attributes: # pragma no branch assert attributes[ "committed_at" ] is None or isinstance( attributes[ "committed_at" ], ( str, unicode ) ), attributes[ "committed_at" ] - self._committed_at = attributes[ "committed_at" ] + self._committed_at = None if attributes[ "committed_at" ] is None else datetime.datetime.strptime( attributes[ "committed_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "url" in attributes: # pragma no branch assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self._url = attributes[ "url" ] diff --git a/src/github/Hook.py b/src/github/Hook.py index 537f46b0..b0d63de6 100644 --- a/src/github/Hook.py +++ b/src/github/Hook.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject ########## import HookResponse @@ -117,7 +119,7 @@ class Hook( GithubObject.GithubObject ): self._config = attributes[ "config" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "events" in attributes: # pragma no branch assert attributes[ "events" ] is None or all( isinstance( element, ( str, unicode ) ) for element in attributes[ "events" ] ), attributes[ "events" ] self._events = attributes[ "events" ] @@ -132,7 +134,7 @@ class Hook( GithubObject.GithubObject ): self._name = attributes[ "name" ] if "updated_at" in attributes: # pragma no branch assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = attributes[ "updated_at" ] + self._updated_at = None if attributes[ "updated_at" ] is None else datetime.datetime.strptime( attributes[ "updated_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "url" in attributes: # pragma no branch assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self._url = attributes[ "url" ] diff --git a/src/github/Issue.py b/src/github/Issue.py index 7e29d487..72578b96 100644 --- a/src/github/Issue.py +++ b/src/github/Issue.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject import PaginatedList ########## @@ -276,7 +278,7 @@ class Issue( GithubObject.GithubObject ): self._body = attributes[ "body" ] if "closed_at" in attributes: # pragma no branch assert attributes[ "closed_at" ] is None or isinstance( attributes[ "closed_at" ], ( str, unicode ) ), attributes[ "closed_at" ] - self._closed_at = attributes[ "closed_at" ] + self._closed_at = None if attributes[ "closed_at" ] is None else datetime.datetime.strptime( attributes[ "closed_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "closed_by" in attributes: # pragma no branch assert attributes[ "closed_by" ] is None or isinstance( attributes[ "closed_by" ], dict ), attributes[ "closed_by" ] self._closed_by = None if attributes[ "closed_by" ] is None else NamedUser.NamedUser( self._requester, attributes[ "closed_by" ], completed = False ) @@ -285,7 +287,7 @@ class Issue( GithubObject.GithubObject ): self._comments = attributes[ "comments" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "html_url" in attributes: # pragma no branch assert attributes[ "html_url" ] is None or isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] self._html_url = attributes[ "html_url" ] @@ -318,7 +320,7 @@ class Issue( GithubObject.GithubObject ): self._title = attributes[ "title" ] if "updated_at" in attributes: # pragma no branch assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = attributes[ "updated_at" ] + self._updated_at = None if attributes[ "updated_at" ] is None else datetime.datetime.strptime( attributes[ "updated_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "url" in attributes: # pragma no branch assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self._url = attributes[ "url" ] diff --git a/src/github/IssueComment.py b/src/github/IssueComment.py index db19f812..4b0973a2 100644 --- a/src/github/IssueComment.py +++ b/src/github/IssueComment.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject ########## import NamedUser @@ -73,13 +75,13 @@ class IssueComment( GithubObject.GithubObject ): self._body = attributes[ "body" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "id" in attributes: # pragma no branch assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] self._id = attributes[ "id" ] if "updated_at" in attributes: # pragma no branch assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = attributes[ "updated_at" ] + self._updated_at = None if attributes[ "updated_at" ] is None else datetime.datetime.strptime( attributes[ "updated_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "url" in attributes: # pragma no branch assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self._url = attributes[ "url" ] diff --git a/src/github/IssueEvent.py b/src/github/IssueEvent.py index 09f395fc..1c9e23f5 100644 --- a/src/github/IssueEvent.py +++ b/src/github/IssueEvent.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject ########## import Issue @@ -60,7 +62,7 @@ class IssueEvent( GithubObject.GithubObject ): self._commit_id = attributes[ "commit_id" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "event" in attributes: # pragma no branch assert attributes[ "event" ] is None or isinstance( attributes[ "event" ], ( str, unicode ) ), attributes[ "event" ] self._event = attributes[ "event" ] diff --git a/src/github/Milestone.py b/src/github/Milestone.py index 002dc0d8..ed8eb8cc 100644 --- a/src/github/Milestone.py +++ b/src/github/Milestone.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject import PaginatedList ########## @@ -76,7 +78,7 @@ class Milestone( GithubObject.GithubObject ): assert isinstance( title, ( str, unicode ) ), title assert state is GithubObject.NotSet or isinstance( state, ( str, unicode ) ), state assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description - assert due_on is GithubObject.NotSet or isinstance( due_on, ( str, unicode ) ), due_on + assert due_on is GithubObject.NotSet or isinstance( due_on, datetime.date ), due_on post_parameters = { "title": title, } @@ -85,7 +87,7 @@ class Milestone( GithubObject.GithubObject ): if description is not GithubObject.NotSet: post_parameters[ "description" ] = description if due_on is not GithubObject.NotSet: - post_parameters[ "due_on" ] = due_on + post_parameters[ "due_on" ] = due_on.strftime( "%Y-%m-%d" ) status, headers, data = self._request( "PATCH", self.url, @@ -133,7 +135,7 @@ class Milestone( GithubObject.GithubObject ): self._closed_issues = attributes[ "closed_issues" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "creator" in attributes: # pragma no branch assert attributes[ "creator" ] is None or isinstance( attributes[ "creator" ], dict ), attributes[ "creator" ] self._creator = None if attributes[ "creator" ] is None else NamedUser.NamedUser( self._requester, attributes[ "creator" ], completed = False ) @@ -142,7 +144,7 @@ class Milestone( GithubObject.GithubObject ): self._description = attributes[ "description" ] if "due_on" in attributes: # pragma no branch assert attributes[ "due_on" ] is None or isinstance( attributes[ "due_on" ], ( str, unicode ) ), attributes[ "due_on" ] - self._due_on = attributes[ "due_on" ] + self._due_on = None if attributes[ "due_on" ] is None else datetime.datetime.strptime( attributes[ "due_on" ], "%Y-%m-%dT%H:%M:%SZ" ) if "id" in attributes: # pragma no branch assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] self._id = attributes[ "id" ] diff --git a/src/github/NamedUser.py b/src/github/NamedUser.py index 34501855..b31159ef 100644 --- a/src/github/NamedUser.py +++ b/src/github/NamedUser.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject import PaginatedList ########## @@ -380,7 +382,7 @@ class NamedUser( GithubObject.GithubObject ): self._contributions = attributes[ "contributions" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "disk_usage" in attributes: # pragma no branch assert attributes[ "disk_usage" ] is None or isinstance( attributes[ "disk_usage" ], int ), attributes[ "disk_usage" ] self._disk_usage = attributes[ "disk_usage" ] diff --git a/src/github/Organization.py b/src/github/Organization.py index f42b1b3b..0bf2fd3b 100644 --- a/src/github/Organization.py +++ b/src/github/Organization.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject import PaginatedList ########## @@ -424,7 +426,7 @@ class Organization( GithubObject.GithubObject ): self._company = attributes[ "company" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "disk_usage" in attributes: # pragma no branch assert attributes[ "disk_usage" ] is None or isinstance( attributes[ "disk_usage" ], int ), attributes[ "disk_usage" ] self._disk_usage = attributes[ "disk_usage" ] diff --git a/src/github/PullRequest.py b/src/github/PullRequest.py index 5534b010..31e4e54c 100644 --- a/src/github/PullRequest.py +++ b/src/github/PullRequest.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject import PaginatedList ########## @@ -304,7 +306,7 @@ class PullRequest( GithubObject.GithubObject ): self._changed_files = attributes[ "changed_files" ] if "closed_at" in attributes: # pragma no branch assert attributes[ "closed_at" ] is None or isinstance( attributes[ "closed_at" ], ( str, unicode ) ), attributes[ "closed_at" ] - self._closed_at = attributes[ "closed_at" ] + self._closed_at = None if attributes[ "closed_at" ] is None else datetime.datetime.strptime( attributes[ "closed_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "comments" in attributes: # pragma no branch assert attributes[ "comments" ] is None or isinstance( attributes[ "comments" ], int ), attributes[ "comments" ] self._comments = attributes[ "comments" ] @@ -313,7 +315,7 @@ class PullRequest( GithubObject.GithubObject ): self._commits = attributes[ "commits" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "deletions" in attributes: # pragma no branch assert attributes[ "deletions" ] is None or isinstance( attributes[ "deletions" ], int ), attributes[ "deletions" ] self._deletions = attributes[ "deletions" ] @@ -340,7 +342,7 @@ class PullRequest( GithubObject.GithubObject ): self._merged = attributes[ "merged" ] if "merged_at" in attributes: # pragma no branch assert attributes[ "merged_at" ] is None or isinstance( attributes[ "merged_at" ], ( str, unicode ) ), attributes[ "merged_at" ] - self._merged_at = attributes[ "merged_at" ] + self._merged_at = None if attributes[ "merged_at" ] is None else datetime.datetime.strptime( attributes[ "merged_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "merged_by" in attributes: # pragma no branch assert attributes[ "merged_by" ] is None or isinstance( attributes[ "merged_by" ], dict ), attributes[ "merged_by" ] self._merged_by = None if attributes[ "merged_by" ] is None else NamedUser.NamedUser( self._requester, attributes[ "merged_by" ], completed = False ) @@ -361,7 +363,7 @@ class PullRequest( GithubObject.GithubObject ): self._title = attributes[ "title" ] if "updated_at" in attributes: # pragma no branch assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = attributes[ "updated_at" ] + self._updated_at = None if attributes[ "updated_at" ] is None else datetime.datetime.strptime( attributes[ "updated_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "url" in attributes: # pragma no branch assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self._url = attributes[ "url" ] diff --git a/src/github/PullRequestComment.py b/src/github/PullRequestComment.py index 6c720d9c..f793217b 100644 --- a/src/github/PullRequestComment.py +++ b/src/github/PullRequestComment.py @@ -1,6 +1,8 @@ # WARNING: this file is generated automaticaly. # Do not modify it manually, your work would be lost. +import datetime +########## import GithubObject ########## import NamedUser @@ -106,7 +108,7 @@ class PullRequestComment( GithubObject.GithubObject ): self._commit_id = attributes[ "commit_id" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "id" in attributes: # pragma no branch assert attributes[ "id" ] is None or isinstance( attributes[ "id" ], int ), attributes[ "id" ] self._id = attributes[ "id" ] @@ -124,7 +126,7 @@ class PullRequestComment( GithubObject.GithubObject ): self._position = attributes[ "position" ] if "updated_at" in attributes: # pragma no branch assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = attributes[ "updated_at" ] + self._updated_at = None if attributes[ "updated_at" ] is None else datetime.datetime.strptime( attributes[ "updated_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "url" in attributes: # pragma no branch assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self._url = attributes[ "url" ] diff --git a/src/github/Repository.py b/src/github/Repository.py index 7655191b..9f958722 100644 --- a/src/github/Repository.py +++ b/src/github/Repository.py @@ -2,6 +2,7 @@ # Do not modify it manually, your work would be lost. import urllib +import datetime ########## import GithubObject import PaginatedList @@ -408,7 +409,7 @@ class Repository( GithubObject.GithubObject ): assert isinstance( title, ( str, unicode ) ), title assert state is GithubObject.NotSet or isinstance( state, ( str, unicode ) ), state assert description is GithubObject.NotSet or isinstance( description, ( str, unicode ) ), description - assert due_on is GithubObject.NotSet or isinstance( due_on, ( str, unicode ) ), due_on + assert due_on is GithubObject.NotSet or isinstance( due_on, datetime.date ), due_on post_parameters = { "title": title, } @@ -417,7 +418,7 @@ class Repository( GithubObject.GithubObject ): if description is not GithubObject.NotSet: post_parameters[ "description" ] = description if due_on is not GithubObject.NotSet: - post_parameters[ "due_on" ] = due_on + post_parameters[ "due_on" ] = due_on.strftime( "%Y-%m-%d" ) status, headers, data = self._request( "POST", self.url + "/milestones", @@ -768,7 +769,7 @@ class Repository( GithubObject.GithubObject ): assert labels is GithubObject.NotSet or all( isinstance( element, Label.Label ) for element in labels ), labels assert sort is GithubObject.NotSet or isinstance( sort, ( str, unicode ) ), sort assert direction is GithubObject.NotSet or isinstance( direction, ( str, unicode ) ), direction - assert since is GithubObject.NotSet or isinstance( since, ( str, unicode ) ), since + assert since is GithubObject.NotSet or isinstance( since, datetime.datetime ), since url_parameters = dict() if milestone is not GithubObject.NotSet: if isinstance( milestone, str ): @@ -791,7 +792,7 @@ class Repository( GithubObject.GithubObject ): if direction is not GithubObject.NotSet: url_parameters[ "direction" ] = direction if since is not GithubObject.NotSet: - url_parameters[ "since" ] = since + url_parameters[ "since" ] = since.strftime( "%Y-%m-%dT%H:%M:%SZ" ) status, headers, data = self._request( "GET", self.url + "/issues", @@ -1082,7 +1083,7 @@ class Repository( GithubObject.GithubObject ): self._clone_url = attributes[ "clone_url" ] if "created_at" in attributes: # pragma no branch assert attributes[ "created_at" ] is None or isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] - self._created_at = attributes[ "created_at" ] + self._created_at = None if attributes[ "created_at" ] is None else datetime.datetime.strptime( attributes[ "created_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "description" in attributes: # pragma no branch assert attributes[ "description" ] is None or isinstance( attributes[ "description" ], ( str, unicode ) ), attributes[ "description" ] self._description = attributes[ "description" ] @@ -1145,7 +1146,7 @@ class Repository( GithubObject.GithubObject ): self._private = attributes[ "private" ] if "pushed_at" in attributes: # pragma no branch assert attributes[ "pushed_at" ] is None or isinstance( attributes[ "pushed_at" ], ( str, unicode ) ), attributes[ "pushed_at" ] - self._pushed_at = attributes[ "pushed_at" ] + self._pushed_at = None if attributes[ "pushed_at" ] is None else datetime.datetime.strptime( attributes[ "pushed_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "size" in attributes: # pragma no branch assert attributes[ "size" ] is None or isinstance( attributes[ "size" ], int ), attributes[ "size" ] self._size = attributes[ "size" ] @@ -1160,7 +1161,7 @@ class Repository( GithubObject.GithubObject ): self._svn_url = attributes[ "svn_url" ] if "updated_at" in attributes: # pragma no branch assert attributes[ "updated_at" ] is None or isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] - self._updated_at = attributes[ "updated_at" ] + self._updated_at = None if attributes[ "updated_at" ] is None else datetime.datetime.strptime( attributes[ "updated_at" ], "%Y-%m-%dT%H:%M:%SZ" ) if "url" in attributes: # pragma no branch assert attributes[ "url" ] is None or isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self._url = attributes[ "url" ] diff --git a/test/AuthenticatedUser.py b/test/AuthenticatedUser.py index 47290bf8..1ec996bc 100644 --- a/test/AuthenticatedUser.py +++ b/test/AuthenticatedUser.py @@ -1,6 +1,7 @@ import Framework import github +import datetime class AuthenticatedUser( Framework.TestCase ): def setUp( self ): @@ -13,7 +14,7 @@ class AuthenticatedUser( Framework.TestCase ): self.assertEqual( self.user.blog, "http://vincent-jacques.net" ) self.assertEqual( self.user.collaborators, 0 ) self.assertEqual( self.user.company, "Criteo" ) - self.assertEqual( self.user.created_at, "2010-07-09T06:10:06Z" ) + self.assertEqual( self.user.created_at, datetime.datetime( 2010, 7, 9, 6, 10, 6 ) ) self.assertEqual( self.user.disk_usage, 16692 ) self.assertEqual( self.user.email, "vincent@vincent-jacques.net" ) self.assertEqual( self.user.followers, 13 ) diff --git a/test/Authorization.py b/test/Authorization.py index bd2bdc3f..9a39ef0a 100644 --- a/test/Authorization.py +++ b/test/Authorization.py @@ -1,5 +1,7 @@ import Framework +import datetime + class Authorization( Framework.TestCase ): def setUp( self ): Framework.TestCase.setUp( self ) @@ -8,13 +10,13 @@ class Authorization( Framework.TestCase ): def testAttributes( self ): self.assertEqual( self.authorization.app.url, "http://developer.github.com/v3/oauth/#oauth-authorizations-api" ) self.assertEqual( self.authorization.app.name, "GitHub API" ) - self.assertEqual( self.authorization.created_at, "2012-05-22T18:03:17Z" ) + self.assertEqual( self.authorization.created_at, datetime.datetime( 2012, 5, 22, 18, 3, 17 ) ) self.assertEqual( self.authorization.id, 372259 ) self.assertEqual( self.authorization.note, None ) self.assertEqual( self.authorization.note_url, None ) self.assertEqual( self.authorization.scopes, [] ) self.assertEqual( self.authorization.token, "82459c4500086f8f0cc67d2936c17d1e27ad1c33" ) - self.assertEqual( self.authorization.updated_at, "2012-05-22T18:03:17Z" ) + self.assertEqual( self.authorization.updated_at, datetime.datetime( 2012, 5, 22, 18, 3, 17 ) ) self.assertEqual( self.authorization.url, "https://api.github.com/authorizations/372259" ) def testEdit( self ): diff --git a/test/CommitComment.py b/test/CommitComment.py index 3b669b45..0e2b4227 100644 --- a/test/CommitComment.py +++ b/test/CommitComment.py @@ -1,5 +1,7 @@ import Framework +import datetime + class CommitComment( Framework.TestCase ): def setUp( self ): Framework.TestCase.setUp( self ) @@ -8,13 +10,13 @@ class CommitComment( Framework.TestCase ): def testAttributes( self ): self.assertEqual( self.comment.body, "Comment created by PyGithub" ) self.assertEqual( self.comment.commit_id, "6945921c529be14c3a8f566dd1e483674516d46d" ) - self.assertEqual( self.comment.created_at, "2012-05-22T18:40:18Z" ) + self.assertEqual( self.comment.created_at, datetime.datetime( 2012, 5, 22, 18, 40, 18 ) ) self.assertEqual( self.comment.html_url, "https://github.com/jacquev6/PyGithub/commit/6945921c529be14c3a8f566dd1e483674516d46d#commitcomment-1361949" ) self.assertEqual( self.comment.id, 1361949 ) self.assertEqual( self.comment.line, None ) self.assertEqual( self.comment.path, None ) self.assertEqual( self.comment.position, None ) - self.assertEqual( self.comment.updated_at, "2012-05-22T18:40:18Z" ) + self.assertEqual( self.comment.updated_at, datetime.datetime( 2012, 5, 22, 18, 40, 18 ) ) self.assertEqual( self.comment.url, "https://api.github.com/repos/jacquev6/PyGithub/comments/1361949" ) self.assertEqual( self.comment.user.login, "jacquev6" ) diff --git a/test/Download.py b/test/Download.py index d53149ff..02554b68 100644 --- a/test/Download.py +++ b/test/Download.py @@ -1,5 +1,7 @@ import Framework +import datetime + class Download( Framework.TestCase ): def setUp( self ): Framework.TestCase.setUp( self ) @@ -10,7 +12,7 @@ class Download( Framework.TestCase ): self.assertEqual( self.download.acl, None ) self.assertEqual( self.download.bucket, None ) self.assertEqual( self.download.content_type, "text/plain" ) - self.assertEqual( self.download.created_at, "2012-05-22T18:58:32Z" ) + self.assertEqual( self.download.created_at, datetime.datetime( 2012, 5, 22, 18, 58, 32 ) ) self.assertEqual( self.download.description, None ) self.assertEqual( self.download.download_count, 0 ) self.assertEqual( self.download.expirationdate, None ) diff --git a/test/Event.py b/test/Event.py index 98c2c585..3f53e648 100644 --- a/test/Event.py +++ b/test/Event.py @@ -1,5 +1,7 @@ import Framework +import datetime + class Event( Framework.TestCase ): def setUp( self ): Framework.TestCase.setUp( self ) @@ -7,7 +9,7 @@ class Event( Framework.TestCase ): def testAttributes( self ): self.assertEqual( self.event.actor.login, "jacquev6" ) - self.assertEqual( self.event.created_at, "2012-05-26T10:01:39Z" ) + self.assertEqual( self.event.created_at, datetime.datetime( 2012, 5, 26, 10, 1, 39 ) ) self.assertEqual( self.event.id, "1556114751" ) self.assertEqual( self.event.org, None ) self.assertEqual( self.event.payload, {u'commits': [{u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'sha': u'5bb654d26dd014d36794acd1e6ecf3736f12aad7', u'message': u'Implement the three authentication schemes', u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/cb0313157bf904f2d364377d35d9397b269547a5', u'sha': u'cb0313157bf904f2d364377d35d9397b269547a5', u'message': u"Merge branch 'topic/Authentication' into develop", u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'sha': u'0cec0d25e606c023a62a4fc7cdc815309ebf6d16', u'message': u'Publish version 0.7', u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'sha': u'ecda065e01876209d2bdf5fe4e91cee8ffaa9ff7', u'message': u"Merge branch 'develop'", u'distinct': False, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/3a3bf4763192ee1234eb0557628133e06f3dfc76', u'sha': u'3a3bf4763192ee1234eb0557628133e06f3dfc76', u'message': u"Merge branch 'master' into topic/RewriteWithGeneratedCode\n\nConflicts:\n\tgithub/Github.py\n\tgithub/Requester.py", u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/608f17794664f61693a3dc05e6056fea8fbef0ff', u'sha': u'608f17794664f61693a3dc05e6056fea8fbef0ff', u'message': u'Restore some form of Authorization header in replay data', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/2c04b8adbd91d38eef4f0767337ab7a12b2f684b', u'sha': u'2c04b8adbd91d38eef4f0767337ab7a12b2f684b', u'message': u'Allow test without pre-set-up Github', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/5b97389988b6fe43e15a079702f6f1671257fb28', u'sha': u'5b97389988b6fe43e15a079702f6f1671257fb28', u'message': u'Test three authentication schemes', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/12747613c5ec00deccf296b8619ad507f7050475', u'sha': u'12747613c5ec00deccf296b8619ad507f7050475', u'message': u'Test Issue.getComments', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/2982fa96c5ca75abe717d974d83f9135d664232e', u'sha': u'2982fa96c5ca75abe717d974d83f9135d664232e', u'message': u'Test the new Repository.full_name attribute', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}, {u'url': u'https://api.github.com/repos/jacquev6/PyGithub/commits/619eae8d51c5988f0d2889fc767fa677438ba95d', u'sha': u'619eae8d51c5988f0d2889fc767fa677438ba95d', u'message': u'Improve coverage of AuthenticatedUser', u'distinct': True, u'author': {u'name': u'Vincent Jacques', u'email': u'vincent@vincent-jacques.net'}}], u'head': u'619eae8d51c5988f0d2889fc767fa677438ba95d', u'push_id': 80673538, u'ref': u'refs/heads/topic/RewriteWithGeneratedCode', u'size': 11} ) diff --git a/test/Gist.py b/test/Gist.py index 6609680c..c92c39c9 100644 --- a/test/Gist.py +++ b/test/Gist.py @@ -1,6 +1,7 @@ import Framework import github +import datetime class Gist( Framework.TestCase ): def setUp( self ): @@ -9,7 +10,7 @@ class Gist( Framework.TestCase ): def testAttributes( self ): self.assertEquals( self.gist.comments, 0 ) - self.assertEquals( self.gist.created_at, "2012-02-29T16:47:12Z" ) + self.assertEquals( self.gist.created_at, datetime.datetime( 2012, 2, 29, 16, 47, 12 ) ) self.assertEquals( self.gist.description, "How to error 500 Github API v3, as requested by Rick (GitHub Staff)" ) self.assertEquals( self.gist.files.keys(), [ "fail_github.py" ] ) self.assertEquals( self.gist.files[ "fail_github.py" ].size, 1636 ) @@ -24,26 +25,26 @@ class Gist( Framework.TestCase ): self.assertEquals( self.gist.history[ 0 ].change_status.additions, 52 ) self.assertEquals( self.gist.history[ 0 ].change_status.deletions, 0 ) self.assertEquals( self.gist.history[ 0 ].change_status.total, 52 ) - self.assertEquals( self.gist.history[ 0 ].committed_at, "2012-02-29T16:47:12Z" ) + self.assertEquals( self.gist.history[ 0 ].committed_at, datetime.datetime( 2012, 2, 29, 16, 47, 12 ) ) self.assertEquals( self.gist.history[ 0 ].url, "https://api.github.com/gists/2729810/a40de483e42ba33bda308371c0ef8383db73be9e" ) self.assertEquals( self.gist.history[ 0 ].user.login, "jacquev6" ) self.assertEquals( self.gist.history[ 0 ].version, "a40de483e42ba33bda308371c0ef8383db73be9e" ) self.assertEquals( self.gist.html_url, "https://gist.github.com/2729810" ) self.assertEquals( self.gist.id, "2729810" ) self.assertEquals( self.gist.public, True ) - self.assertEquals( self.gist.updated_at, "2012-02-29T16:47:12Z" ) + self.assertEquals( self.gist.updated_at, datetime.datetime( 2012, 2, 29, 16, 47, 12 ) ) self.assertEquals( self.gist.url, "https://api.github.com/gists/2729810" ) self.assertEquals( self.gist.user.login, "jacquev6" ) def testEditWithoutParameters( self ): self.gist.edit() self.assertEquals( self.gist.description, "Gist created by PyGithub" ) - self.assertEquals( self.gist.updated_at, "2012-05-19T07:00:58Z" ) + self.assertEquals( self.gist.updated_at, datetime.datetime( 2012, 5, 19, 7, 0, 58 ) ) def testEditWithAllParameters( self ): self.gist.edit( "Description edited by PyGithub", { "barbaz.txt": github.InputFileContent( "File also created by PyGithub" ) } ) self.assertEquals( self.gist.description, "Description edited by PyGithub" ) - self.assertEquals( self.gist.updated_at, "2012-05-19T07:06:10Z" ) + self.assertEquals( self.gist.updated_at, datetime.datetime( 2012, 5, 19, 7, 6, 10 ) ) self.assertEquals( self.gist.files.keys(), [ "foobar.txt", "barbaz.txt" ] ) def testCreateComment( self ): diff --git a/test/GistComment.py b/test/GistComment.py index 16f6c58c..da5fb8cf 100644 --- a/test/GistComment.py +++ b/test/GistComment.py @@ -1,5 +1,7 @@ import Framework +import datetime + class GistComment( Framework.TestCase ): def setUp( self ): Framework.TestCase.setUp( self ) @@ -7,16 +9,16 @@ class GistComment( Framework.TestCase ): def testAttributes( self ): self.assertEquals( self.comment.body, "Comment created by PyGithub" ) - self.assertEquals( self.comment.created_at, "2012-05-19T07:07:57Z" ) + self.assertEquals( self.comment.created_at, datetime.datetime( 2012, 5, 19, 7, 7, 57 ) ) self.assertEquals( self.comment.id, 323629 ) - self.assertEquals( self.comment.updated_at, "2012-05-19T07:07:57Z" ) + self.assertEquals( self.comment.updated_at, datetime.datetime( 2012, 5, 19, 7, 7, 57 ) ) self.assertEquals( self.comment.url, "https://api.github.com/gists/comments/323629" ) self.assertEquals( self.comment.user.login, "jacquev6" ) def testEdit( self ): self.comment.edit( "Comment edited by PyGithub" ) self.assertEquals( self.comment.body, "Comment edited by PyGithub" ) - self.assertEquals( self.comment.updated_at, "2012-05-19T07:12:32Z" ) + self.assertEquals( self.comment.updated_at, datetime.datetime( 2012, 5, 19, 7, 12, 32 ) ) def testDelete( self ): self.comment.delete() diff --git a/test/Hook.py b/test/Hook.py index 2fbef0f4..e845aabf 100644 --- a/test/Hook.py +++ b/test/Hook.py @@ -1,5 +1,7 @@ import Framework +import datetime + class Hook( Framework.TestCase ): def setUp( self ): Framework.TestCase.setUp( self ) @@ -8,20 +10,20 @@ class Hook( Framework.TestCase ): def testAttributes( self ): self.assertEqual( self.hook.active, True ) # WTF self.assertEqual( self.hook.config, { "url": "http://foobar.com" } ) - self.assertEqual( self.hook.created_at, "2012-05-19T06:01:45Z" ) + self.assertEqual( self.hook.created_at, datetime.datetime( 2012, 5, 19, 6, 1, 45 ) ) self.assertEqual( self.hook.events, [ "push" ] ) self.assertEqual( self.hook.id, 257993 ) self.assertEqual( self.hook.last_response.status, "ok" ) self.assertEqual( self.hook.last_response.message, "OK" ) self.assertEqual( self.hook.last_response.code, 200 ) self.assertEqual( self.hook.name, "web" ) - self.assertEqual( self.hook.updated_at, "2012-05-29T18:49:47Z" ) + self.assertEqual( self.hook.updated_at, datetime.datetime( 2012, 5, 29, 18, 49, 47 ) ) self.assertEqual( self.hook.url, "https://api.github.com/repos/jacquev6/PyGithub/hooks/257993" ) def testEditWithMinimalParameters( self ): self.hook.edit( "web", { "url": "http://foobar.com/hook" } ) self.assertEqual( self.hook.config, { "url": "http://foobar.com/hook" } ) - self.assertEqual( self.hook.updated_at, "2012-05-19T05:08:16Z" ) + self.assertEqual( self.hook.updated_at, datetime.datetime( 2012, 5, 19, 5, 8, 16 ) ) def testDelete( self ): self.hook.delete() diff --git a/test/Issue.py b/test/Issue.py index 07fdd785..c2567453 100644 --- a/test/Issue.py +++ b/test/Issue.py @@ -1,5 +1,7 @@ import Framework +import datetime + class Issue( Framework.TestCase ): def setUp( self ): Framework.TestCase.setUp( self ) @@ -9,10 +11,10 @@ class Issue( Framework.TestCase ): def testAttributes( self ): self.assertEqual( self.issue.assignee.login, "jacquev6" ) self.assertEqual( self.issue.body, "Body edited by PyGithub" ) - self.assertEqual( self.issue.closed_at, "2012-05-26T14:59:33Z" ) + self.assertEqual( self.issue.closed_at, datetime.datetime( 2012, 5, 26, 14, 59, 33 ) ) self.assertEqual( self.issue.closed_by.login, "jacquev6" ) self.assertEqual( self.issue.comments, 0 ) - self.assertEqual( self.issue.created_at, "2012-05-19T10:38:23Z" ) + self.assertEqual( self.issue.created_at, datetime.datetime( 2012, 5, 19, 10, 38, 23 ) ) self.assertEqual( self.issue.html_url, "https://github.com/jacquev6/PyGithub/issues/28" ) self.assertEqual( self.issue.id, 4653757 ) self.assertListKeyEqual( self.issue.labels, lambda l: l.name, [ "Bug", "Project management", "Question" ] ) @@ -23,7 +25,7 @@ class Issue( Framework.TestCase ): self.assertEqual( self.issue.pull_request.html_url, None ) self.assertEqual( self.issue.state, "closed" ) self.assertEqual( self.issue.title, "Issue created by PyGithub" ) - self.assertEqual( self.issue.updated_at, "2012-05-26T14:59:33Z" ) + self.assertEqual( self.issue.updated_at, datetime.datetime( 2012, 5, 26, 14, 59, 33 ) ) self.assertEqual( self.issue.url, "https://api.github.com/repos/jacquev6/PyGithub/issues/28" ) self.assertEqual( self.issue.user.login, "jacquev6" ) diff --git a/test/IssueComment.py b/test/IssueComment.py index 62874744..9af45117 100644 --- a/test/IssueComment.py +++ b/test/IssueComment.py @@ -1,5 +1,7 @@ import Framework +import datetime + class IssueComment( Framework.TestCase ): def setUp( self ): Framework.TestCase.setUp( self ) @@ -7,16 +9,16 @@ class IssueComment( Framework.TestCase ): def testAttributes( self ): self.assertEqual( self.comment.body, "Comment created by PyGithub" ) - self.assertEqual( self.comment.created_at, "2012-05-20T11:46:42Z" ) + self.assertEqual( self.comment.created_at, datetime.datetime( 2012, 5, 20, 11, 46, 42 ) ) self.assertEqual( self.comment.id, 5808311 ) - self.assertEqual( self.comment.updated_at, "2012-05-20T11:46:42Z" ) + self.assertEqual( self.comment.updated_at, datetime.datetime( 2012, 5, 20, 11, 46, 42 ) ) self.assertEqual( self.comment.url, "https://api.github.com/repos/jacquev6/PyGithub/issues/comments/5808311" ) self.assertEqual( self.comment.user.login, "jacquev6" ) def testEdit( self ): self.comment.edit( "Comment edited by PyGithub" ) self.assertEqual( self.comment.body, "Comment edited by PyGithub" ) - self.assertEqual( self.comment.updated_at, "2012-05-20T11:53:59Z" ) + self.assertEqual( self.comment.updated_at, datetime.datetime( 2012, 5, 20, 11, 53, 59 ) ) def testDelete( self ): self.comment.delete() diff --git a/test/IssueEvent.py b/test/IssueEvent.py index 07514c86..0c4f6346 100644 --- a/test/IssueEvent.py +++ b/test/IssueEvent.py @@ -1,5 +1,7 @@ import Framework +import datetime + class IssueEvent( Framework.TestCase ): def setUp( self ): Framework.TestCase.setUp( self ) @@ -8,7 +10,7 @@ class IssueEvent( Framework.TestCase ): def testAttributes( self ): self.assertEqual( self.event.actor.login, "jacquev6" ) self.assertEqual( self.event.commit_id, "ed866fc43833802ab553e5ff8581c81bb00dd433" ) - self.assertEqual( self.event.created_at, "2012-05-27T07:29:25Z" ) + self.assertEqual( self.event.created_at, datetime.datetime( 2012, 5, 27, 7, 29, 25 ) ) self.assertEqual( self.event.event, "referenced" ) self.assertEqual( self.event.id, 16348656 ) self.assertEqual( self.event.issue.number, 30 ) diff --git a/test/Milestone.py b/test/Milestone.py index 2b7d16f4..d62ed8dc 100644 --- a/test/Milestone.py +++ b/test/Milestone.py @@ -1,5 +1,7 @@ import Framework +import datetime + class Milestone( Framework.TestCase ): def setUp( self ): Framework.TestCase.setUp( self ) @@ -7,9 +9,9 @@ class Milestone( Framework.TestCase ): def testAttributes( self ): self.assertEqual( self.milestone.closed_issues, 2 ) - self.assertEqual( self.milestone.created_at, "2012-03-08T12:22:10Z" ) + self.assertEqual( self.milestone.created_at, datetime.datetime( 2012, 3, 8, 12, 22, 10 ) ) self.assertEqual( self.milestone.description, "" ) - self.assertEqual( self.milestone.due_on, "2012-03-13T07:00:00Z" ) + self.assertEqual( self.milestone.due_on, datetime.datetime( 2012, 3, 13, 7, 0, 0 ) ) self.assertEqual( self.milestone.id, 93546 ) self.assertEqual( self.milestone.number, 1 ) self.assertEqual( self.milestone.open_issues, 0 ) @@ -23,11 +25,11 @@ class Milestone( Framework.TestCase ): self.assertEqual( self.milestone.title, "Title edited by PyGithub" ) def testEditWithAllParameters( self ): - self.milestone.edit( "Title edited twice by PyGithub", "closed", "Description edited by PyGithub", due_on = "2012-06-16" ) + self.milestone.edit( "Title edited twice by PyGithub", "closed", "Description edited by PyGithub", due_on = datetime.date( 2012, 6, 16 ) ) self.assertEqual( self.milestone.title, "Title edited twice by PyGithub" ) self.assertEqual( self.milestone.state, "closed" ) self.assertEqual( self.milestone.description, "Description edited by PyGithub" ) - self.assertEqual( self.milestone.due_on, "2012-06-16T07:00:00Z" ) + self.assertEqual( self.milestone.due_on, datetime.datetime( 2012, 6, 16, 7, 0, 0 ) ) def testGetLabels( self ): self.assertListKeyEqual( self.milestone.get_labels(), lambda l: l.name, [ "Public interface", "Project management" ] ) diff --git a/test/NamedUser.py b/test/NamedUser.py index 1ae69224..e8968acc 100644 --- a/test/NamedUser.py +++ b/test/NamedUser.py @@ -1,6 +1,7 @@ import Framework import github +import datetime class NamedUser( Framework.TestCase ): def setUp( self ): @@ -14,7 +15,7 @@ class NamedUser( Framework.TestCase ): self.assertEqual( self.user.blog, "http://nvie.com" ) self.assertEqual( self.user.collaborators, None ) self.assertEqual( self.user.company, "3rd Cloud" ) - self.assertEqual( self.user.created_at, "2009-05-12T21:19:38Z" ) + self.assertEqual( self.user.created_at, datetime.datetime( 2009, 5, 12, 21, 19, 38 ) ) self.assertEqual( self.user.disk_usage, None ) self.assertEqual( self.user.email, "vincent@3rdcloud.com" ) self.assertEqual( self.user.followers, 296 ) @@ -41,7 +42,7 @@ class NamedUser( Framework.TestCase ): self.assertEqual( self.user.blog, "http://vincent-jacques.net" ) self.assertEqual( self.user.collaborators, 0 ) self.assertEqual( self.user.company, "Criteo" ) - self.assertEqual( self.user.created_at, "2010-07-09T06:10:06Z" ) + self.assertEqual( self.user.created_at, datetime.datetime( 2010, 7, 9, 6, 10, 6 ) ) self.assertEqual( self.user.disk_usage, 17080 ) self.assertEqual( self.user.email, "vincent@vincent-jacques.net" ) self.assertEqual( self.user.followers, 13 ) diff --git a/test/Organization.py b/test/Organization.py index 1df5ef1c..eeaccd99 100644 --- a/test/Organization.py +++ b/test/Organization.py @@ -1,5 +1,7 @@ import Framework +import datetime + class Organization( Framework.TestCase ): def setUp( self ): Framework.TestCase.setUp( self ) @@ -11,7 +13,7 @@ class Organization( Framework.TestCase ): self.assertEqual( self.org.blog, None ) self.assertEqual( self.org.collaborators, 0 ) self.assertEqual( self.org.company, None ) - self.assertEqual( self.org.created_at, "2012-02-09T19:20:12Z" ) + self.assertEqual( self.org.created_at, datetime.datetime( 2012, 2, 9, 19, 20, 12 ) ) self.assertEqual( self.org.disk_usage, 112 ) self.assertEqual( self.org.email, None ) self.assertEqual( self.org.followers, 0 ) diff --git a/test/PullRequest.py b/test/PullRequest.py index 652bca0f..2463adfd 100644 --- a/test/PullRequest.py +++ b/test/PullRequest.py @@ -1,5 +1,7 @@ import Framework +import datetime + class PullRequest( Framework.TestCase ): def setUp( self ): Framework.TestCase.setUp( self ) @@ -15,10 +17,10 @@ class PullRequest( Framework.TestCase ): self.assertEqual( self.pull.base.repo.full_name, "jacquev6/PyGithub" ) self.assertEqual( self.pull.body, "Body edited by PyGithub" ) self.assertEqual( self.pull.changed_files, 45 ) - self.assertEqual( self.pull.closed_at, "2012-05-27T10:29:07Z" ) + self.assertEqual( self.pull.closed_at, datetime.datetime( 2012, 5, 27, 10, 29, 7 ) ) self.assertEqual( self.pull.comments, 0 ) self.assertEqual( self.pull.commits, 3 ) - self.assertEqual( self.pull.created_at, "2012-05-27T09:25:36Z" ) + self.assertEqual( self.pull.created_at, datetime.datetime( 2012, 5, 27, 9, 25, 36 ) ) self.assertEqual( self.pull.deletions, 384 ) self.assertEqual( self.pull.diff_url, "https://github.com/jacquev6/PyGithub/pull/31.diff" ) self.assertEqual( self.pull.head.label, "BeaverSoftware:master" ) @@ -27,14 +29,14 @@ class PullRequest( Framework.TestCase ): self.assertEqual( self.pull.issue_url, "https://github.com/jacquev6/PyGithub/issues/31" ) self.assertEqual( self.pull.mergeable, None ) self.assertEqual( self.pull.merged, True ) - self.assertEqual( self.pull.merged_at, "2012-05-27T10:29:07Z" ) + self.assertEqual( self.pull.merged_at, datetime.datetime( 2012, 5, 27, 10, 29, 7 ) ) self.assertEqual( self.pull.merged_by.login, "jacquev6" ) self.assertEqual( self.pull.number, 31 ) self.assertEqual( self.pull.patch_url, "https://github.com/jacquev6/PyGithub/pull/31.patch" ) self.assertEqual( self.pull.review_comments, 1 ) self.assertEqual( self.pull.state, "closed" ) self.assertEqual( self.pull.title, "Title edited by PyGithub" ) - self.assertEqual( self.pull.updated_at, "2012-05-27T10:29:07Z" ) + self.assertEqual( self.pull.updated_at, datetime.datetime( 2012, 5, 27, 10, 29, 7 ) ) self.assertEqual( self.pull.url, "https://api.github.com/repos/jacquev6/PyGithub/pulls/31" ) self.assertEqual( self.pull.user.login, "jacquev6" ) diff --git a/test/PullRequestComment.py b/test/PullRequestComment.py index 3a5abf6a..b3f080dd 100644 --- a/test/PullRequestComment.py +++ b/test/PullRequestComment.py @@ -1,5 +1,7 @@ import Framework +import datetime + class PullRequestComment( Framework.TestCase ): def setUp( self ): Framework.TestCase.setUp( self ) @@ -8,13 +10,13 @@ class PullRequestComment( Framework.TestCase ): def testAttributes( self ): self.assertEqual( self.comment.body, "Comment created by PyGithub" ) self.assertEqual( self.comment.commit_id, "8a4f306d4b223682dd19410d4a9150636ebe4206" ) - self.assertEqual( self.comment.created_at, "2012-05-27T09:40:12Z" ) + self.assertEqual( self.comment.created_at, datetime.datetime( 2012, 5, 27, 9, 40, 12 ) ) self.assertEqual( self.comment.id, 886298 ) self.assertEqual( self.comment.original_commit_id, "8a4f306d4b223682dd19410d4a9150636ebe4206" ) self.assertEqual( self.comment.original_position, 5 ) self.assertEqual( self.comment.path, "src/github/Issue.py" ) self.assertEqual( self.comment.position, 5 ) - self.assertEqual( self.comment.updated_at, "2012-05-27T09:40:12Z" ) + self.assertEqual( self.comment.updated_at, datetime.datetime( 2012, 5, 27, 9, 40, 12 ) ) self.assertEqual( self.comment.url, "https://api.github.com/repos/jacquev6/PyGithub/pulls/comments/886298" ) self.assertEqual( self.comment.user.login, "jacquev6" ) diff --git a/test/Repository.py b/test/Repository.py index a08d287a..1f45e836 100644 --- a/test/Repository.py +++ b/test/Repository.py @@ -1,6 +1,7 @@ import Framework import github +import datetime class Repository( Framework.TestCase ): def setUp( self ): @@ -9,7 +10,7 @@ class Repository( Framework.TestCase ): def testAttributes( self ): self.assertEqual( self.repo.clone_url, "https://github.com/jacquev6/PyGithub.git" ) - self.assertEqual( self.repo.created_at, "2012-02-25T12:53:47Z" ) + self.assertEqual( self.repo.created_at, datetime.datetime( 2012, 2, 25, 12, 53, 47 ) ) self.assertEqual( self.repo.description, "Python library implementing the full Github API v3" ) self.assertEqual( self.repo.fork, False ) self.assertEqual( self.repo.forks, 3 ) @@ -32,12 +33,12 @@ class Repository( Framework.TestCase ): self.assertEqual( self.repo.permissions.pull, True ) self.assertEqual( self.repo.permissions.push, True ) self.assertEqual( self.repo.private, False ) - self.assertEqual( self.repo.pushed_at, "2012-05-27T06:00:28Z" ) + self.assertEqual( self.repo.pushed_at, datetime.datetime( 2012, 5, 27, 6, 0, 28 ) ) self.assertEqual( self.repo.size, 308 ) self.assertEqual( self.repo.source, None ) self.assertEqual( self.repo.ssh_url, "git@github.com:jacquev6/PyGithub.git" ) self.assertEqual( self.repo.svn_url, "https://github.com/jacquev6/PyGithub" ) - self.assertEqual( self.repo.updated_at, "2012-05-27T06:55:28Z" ) + self.assertEqual( self.repo.updated_at, datetime.datetime( 2012, 5, 27, 6, 55, 28 ) ) self.assertEqual( self.repo.url, "https://api.github.com/repos/jacquev6/PyGithub" ) self.assertEqual( self.repo.watchers, 15 ) @@ -54,7 +55,7 @@ class Repository( Framework.TestCase ): self.assertListKeyEqual( self.repo.get_contributors(), lambda c: ( c.login, c.contributions ), [ ( "jacquev6", 355 ) ] ) def testCreateMilestone( self ): - milestone = self.repo.create_milestone( "Milestone created by PyGithub", state = "open", description = "Description created by PyGithub", due_on = "2012-06-15" ) + milestone = self.repo.create_milestone( "Milestone created by PyGithub", state = "open", description = "Description created by PyGithub", due_on = datetime.date( 2012, 6, 15 ) ) self.assertEqual( milestone.number, 5 ) def testCreateMilestoneWithMinimalArguments( self ): @@ -103,10 +104,10 @@ class Repository( Framework.TestCase ): self.assertEqual( download.acl, "public-read" ) self.assertEqual( download.bucket, "github" ) self.assertEqual( download.content_type, "text/richtext" ) - self.assertEqual( download.created_at, "2012-05-22T19:11:49Z" ) + self.assertEqual( download.created_at, datetime.datetime( 2012, 5, 22, 19, 11, 49 ) ) self.assertEqual( download.description, "Download created by PyGithub" ) self.assertEqual( download.download_count, 0 ) - self.assertEqual( download.expirationdate, "2112-05-22T19:11:49.000Z" ) + self.assertEqual( download.expirationdate, datetime.datetime( 2112, 5, 22, 19, 11, 49 ) ) self.assertEqual( download.html_url, "https://github.com/downloads/jacquev6/PyGithub/Foobar.txt" ) self.assertEqual( download.id, 242556 ) self.assertEqual( download.mime_type, "text/richtext" ) @@ -267,7 +268,7 @@ class Repository( Framework.TestCase ): self.assertListKeyEqual( self.repo.get_issues( milestone, "closed" ), lambda i: i.id, [ 3624472, 3620132, 3619658, 3561926 ] ) self.assertListKeyEqual( self.repo.get_issues( labels = [ bug ] ), lambda i: i.id, [ 4780155 ] ) self.assertListKeyEqual( self.repo.get_issues( assignee = user, sort = "comments", direction = "asc" ), lambda i: i.id, [ 4793106, 3527231, 3527266, 3624556, 4793216, 3619973, 3624595, 4452000, 3643837, 3628022, 3527245, 4793162, 4356743, 4780155 ] ) - self.assertListKeyEqual( self.repo.get_issues( since = "2012-05-28T23:00:00Z" ), lambda i: i.id, [ 4793216, 4793162, 4793106, 3624556, 3619973, 3527266 ] ) + self.assertListKeyEqual( self.repo.get_issues( since = datetime.datetime( 2012, 5, 28, 23, 0, 0 ) ), lambda i: i.id, [ 4793216, 4793162, 4793106, 3624556, 3619973, 3527266 ] ) self.assertListKeyEqual( self.repo.get_issues( mentioned = otherUser ), lambda i: i.id, [ 4793162 ] ) def testGetIssuesWithWildcards( self ):