diff --git a/codegen/JsonDescriptionOfGithubApiV3/description.000.human_readable.json b/codegen/JsonDescriptionOfGithubApiV3/description.000.human_readable.json index 4da2bdcf..45ec7654 100644 --- a/codegen/JsonDescriptionOfGithubApiV3/description.000.human_readable.json +++ b/codegen/JsonDescriptionOfGithubApiV3/description.000.human_readable.json @@ -259,14 +259,14 @@ "delete": true, "attributes": [ { "name": "app", "type": "@todo" }, - { "name": "created_at", "type": "@todo" }, - { "name": "id", "type": "@todo" }, - { "name": "note_url", "type": "@todo" }, - { "name": "note", "type": "@todo" }, - { "name": "scopes", "type": "@todo" }, - { "name": "token", "type": "@todo" }, - { "name": "updated_at", "type": "@todo" }, - { "name": "url", "type": "@todo" } + { "name": "created_at", "type": "string" }, + { "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": "url", "type": "string" } ] }, { @@ -287,15 +287,15 @@ { "name": "CommitFile", "attributes": [ - { "name": "additions", "type": "@todo" }, - { "name": "blob_url", "type": "@todo" }, - { "name": "changes", "type": "@todo" }, - { "name": "deletions", "type": "@todo" }, - { "name": "filename", "type": "@todo" }, - { "name": "patch", "type": "@todo" }, - { "name": "raw_url", "type": "@todo" }, - { "name": "sha", "type": "@todo" }, - { "name": "status", "type": "@todo" } + { "name": "additions", "type": "integer" }, + { "name": "blob_url", "type": "string" }, + { "name": "changes", "type": "integer" }, + { "name": "deletions", "type": "integer" }, + { "name": "filename", "type": "string" }, + { "name": "patch", "type": "string" }, + { "name": "raw_url", "type": "string" }, + { "name": "sha", "type": "string" }, + { "name": "status", "type": "string" } ] }, { @@ -358,37 +358,37 @@ "isCompletable": true, "delete": true, "attributes": [ - { "name": "accesskeyid", "type": "@todo" }, - { "name": "acl", "type": "@todo" }, - { "name": "bucket", "type": "@todo" }, - { "name": "content_type", "type": "@todo" }, - { "name": "created_at", "type": "@todo" }, - { "name": "description", "type": "@todo" }, - { "name": "download_count", "type": "@todo" }, - { "name": "expirationdate", "type": "@todo" }, - { "name": "html_url", "type": "@todo" }, - { "name": "id", "type": "@todo" }, - { "name": "mime_type", "type": "@todo" }, - { "name": "name", "type": "@todo" }, - { "name": "path", "type": "@todo" }, - { "name": "policy", "type": "@todo" }, - { "name": "prefix", "type": "@todo" }, - { "name": "redirect", "type": "@todo" }, - { "name": "s3_url", "type": "@todo" }, - { "name": "signature", "type": "@todo" }, - { "name": "size", "type": "@todo" }, - { "name": "url", "type": "@todo" } + { "name": "accesskeyid", "type": "string" }, + { "name": "acl", "type": "string" }, + { "name": "bucket", "type": "string" }, + { "name": "content_type", "type": "string" }, + { "name": "created_at", "type": "string" }, + { "name": "description", "type": "string" }, + { "name": "download_count", "type": "integer" }, + { "name": "expirationdate", "type": "string" }, + { "name": "html_url", "type": "string" }, + { "name": "id", "type": "integer" }, + { "name": "mime_type", "type": "string" }, + { "name": "name", "type": "string" }, + { "name": "path", "type": "string" }, + { "name": "policy", "type": "string" }, + { "name": "prefix", "type": "string" }, + { "name": "redirect", "type": "bool" }, + { "name": "s3_url", "type": "string" }, + { "name": "signature", "type": "string" }, + { "name": "size", "type": "integer" }, + { "name": "url", "type": "string" } ] }, { "name": "Event", "attributes": [ { "name": "actor", "type": "NamedUser" }, - { "name": "created_at", "type": "@todo" }, - { "name": "id", "type": "@todo" }, + { "name": "created_at", "type": "string" }, + { "name": "id", "type": "string" }, { "name": "payload", "type": "@todo" }, - { "name": "public", "type": "@todo" }, - { "name": "type", "type": "@todo" }, + { "name": "public", "type": "bool" }, + { "name": "type", "type": "string" }, { "name": "org", "type": "Organization" }, { "name": "repo", "type": "Repository" } ] @@ -514,11 +514,11 @@ }, "delete": true, "attributes": [ - { "name": "body", "type": "@todo" }, - { "name": "created_at", "type": "@todo" }, - { "name": "id", "type": "@todo" }, - { "name": "updated_at", "type": "@todo" }, - { "name": "url", "type": "@todo" }, + { "name": "body", "type": "string" }, + { "name": "created_at", "type": "string" }, + { "name": "id", "type": "integer" }, + { "name": "updated_at", "type": "string" }, + { "name": "url", "type": "string" }, { "name": "user", "type": "NamedUser" } ] }, @@ -623,15 +623,15 @@ }, "delete": true, "attributes": [ - { "name": "active", "type": "@todo" }, + { "name": "active", "type": "bool" }, { "name": "config", "type": "@todo" }, - { "name": "created_at", "type": "@todo" }, - { "name": "events", "type": "@todo" }, - { "name": "id", "type": "@todo" }, + { "name": "created_at", "type": "string" }, + { "name": "events", "type": "list:string" }, + { "name": "id", "type": "integer" }, { "name": "last_response", "type": "@todo" }, - { "name": "name", "type": "@todo" }, - { "name": "updated_at", "type": "@todo" }, - { "name": "url", "type": "@todo" } + { "name": "name", "type": "string" }, + { "name": "updated_at", "type": "string" }, + { "name": "url", "type": "string" } ], "additionalMethods": [ { @@ -737,11 +737,11 @@ }, "delete": true, "attributes": [ - { "name": "body", "type": "@todo" }, - { "name": "created_at", "type": "@todo" }, - { "name": "id", "type": "@todo" }, - { "name": "updated_at", "type": "@todo" }, - { "name": "url", "type": "@todo" }, + { "name": "body", "type": "string" }, + { "name": "created_at", "type": "string" }, + { "name": "id", "type": "integer" }, + { "name": "updated_at", "type": "string" }, + { "name": "url", "type": "string" }, { "name": "user", "type": "NamedUser" } ] }, @@ -768,9 +768,9 @@ }, "delete": true, "attributes": [ - { "name": "color", "type": "@todo" }, - { "name": "name", "type": "@todo" }, - { "name": "url", "type": "@todo" } + { "name": "color", "type": "string" }, + { "name": "name", "type": "string" }, + { "name": "url", "type": "string" } ], "identity": [ { @@ -1108,31 +1108,31 @@ ] }, "attributes": [ - { "name": "additions", "type": "@todo" }, + { "name": "additions", "type": "integer" }, { "name": "base", "type": "@todo" }, - { "name": "body", "type": "@todo" }, - { "name": "changed_files", "type": "@todo" }, - { "name": "closed_at", "type": "@todo" }, - { "name": "comments", "type": "@todo" }, - { "name": "commits", "type": "@todo" }, - { "name": "created_at", "type": "@todo" }, - { "name": "deletions", "type": "@todo" }, - { "name": "diff_url", "type": "@todo" }, + { "name": "body", "type": "string" }, + { "name": "changed_files", "type": "integer" }, + { "name": "closed_at", "type": "string" }, + { "name": "comments", "type": "integer" }, + { "name": "commits", "type": "integer" }, + { "name": "created_at", "type": "string" }, + { "name": "deletions", "type": "integer" }, + { "name": "diff_url", "type": "string" }, { "name": "head", "type": "@todo" }, - { "name": "html_url", "type": "@todo" }, - { "name": "id", "type": "@todo" }, - { "name": "issue_url", "type": "@todo" }, - { "name": "mergeable", "type": "@todo" }, - { "name": "merged_at", "type": "@todo" }, - { "name": "merged_by", "type": "@todo" }, - { "name": "merged", "type": "@todo" }, - { "name": "number", "type": "@todo" }, - { "name": "patch_url", "type": "@todo" }, - { "name": "review_comments", "type": "@todo" }, - { "name": "state", "type": "@todo" }, - { "name": "title", "type": "@todo" }, - { "name": "updated_at", "type": "@todo" }, - { "name": "url", "type": "@todo" }, + { "name": "html_url", "type": "string" }, + { "name": "id", "type": "integer" }, + { "name": "issue_url", "type": "string" }, + { "name": "mergeable", "type": "bool" }, + { "name": "merged_at", "type": "string" }, + { "name": "merged_by", "type": "NamedUser" }, + { "name": "merged", "type": "bool" }, + { "name": "number", "type": "integer" }, + { "name": "patch_url", "type": "string" }, + { "name": "review_comments", "type": "integer" }, + { "name": "state", "type": "string" }, + { "name": "title", "type": "string" }, + { "name": "updated_at", "type": "string" }, + { "name": "url", "type": "string" }, { "name": "user", "type": "NamedUser" } ], "collections": [ @@ -1222,31 +1222,31 @@ }, "delete": true, "attributes": [ - { "name": "body", "type": "@todo" }, - { "name": "commit_id", "type": "@todo" }, - { "name": "created_at", "type": "@todo" }, - { "name": "id", "type": "@todo" }, - { "name": "path", "type": "@todo" }, - { "name": "position", "type": "@todo" }, - { "name": "original_position", "type": "@todo" }, - { "name": "original_commit_id", "type": "@todo" }, - { "name": "updated_at", "type": "@todo" }, - { "name": "url", "type": "@todo" }, + { "name": "body", "type": "string" }, + { "name": "commit_id", "type": "string" }, + { "name": "created_at", "type": "string" }, + { "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": "url", "type": "string" }, { "name": "user", "type": "NamedUser" } ] }, { "name": "PullRequestFile", "attributes": [ - { "name": "additions", "type": "@todo" }, - { "name": "blob_url", "type": "@todo" }, - { "name": "changes", "type": "@todo" }, - { "name": "deletions", "type": "@todo" }, - { "name": "filename", "type": "@todo" }, - { "name": "patch", "type": "@todo" }, - { "name": "raw_url", "type": "@todo" }, - { "name": "sha", "type": "@todo" }, - { "name": "status", "type": "@todo" } + { "name": "additions", "type": "integer" }, + { "name": "blob_url", "type": "string" }, + { "name": "changes", "type": "integer" }, + { "name": "deletions", "type": "integer" }, + { "name": "filename", "type": "string" }, + { "name": "patch", "type": "string" }, + { "name": "raw_url", "type": "string" }, + { "name": "sha", "type": "string" }, + { "name": "status", "type": "string" } ] }, { @@ -1730,10 +1730,10 @@ }, "delete": true, "attributes": [ - { "name": "id", "type": "@todo" }, - { "name": "key", "type": "@todo" }, - { "name": "title", "type": "@todo" }, - { "name": "url", "type": "@todo" }, + { "name": "id", "type": "integer" }, + { "name": "key", "type": "string" }, + { "name": "title", "type": "string" }, + { "name": "url", "type": "string" }, { "name": "verified", "type": "bool" } ] }, @@ -1759,12 +1759,12 @@ }, "delete": true, "attributes": [ - { "name": "id", "type": "@todo" }, - { "name": "members_count", "type": "@todo" }, - { "name": "name", "type": "@todo" }, - { "name": "permission", "type": "@todo" }, - { "name": "repos_count", "type": "@todo" }, - { "name": "url", "type": "@todo" } + { "name": "id", "type": "integer" }, + { "name": "members_count", "type": "integer" }, + { "name": "name", "type": "string" }, + { "name": "permission", "type": "string" }, + { "name": "repos_count", "type": "integer" }, + { "name": "url", "type": "string" } ], "collections": [ { @@ -1798,10 +1798,10 @@ }, "delete": true, "attributes": [ - { "name": "id", "type": "@todo" }, - { "name": "key", "type": "@todo" }, - { "name": "title", "type": "@todo" }, - { "name": "url", "type": "@todo" }, + { "name": "id", "type": "integer" }, + { "name": "key", "type": "string" }, + { "name": "title", "type": "string" }, + { "name": "url", "type": "string" }, { "name": "verified", "type": "bool" } ] } diff --git a/codegen/JsonDescriptionOfGithubApiV3/description.001.normalized.json b/codegen/JsonDescriptionOfGithubApiV3/description.001.normalized.json index e39a8098..dda74cb9 100644 --- a/codegen/JsonDescriptionOfGithubApiV3/description.001.normalized.json +++ b/codegen/JsonDescriptionOfGithubApiV3/description.001.normalized.json @@ -1497,7 +1497,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "created_at" }, @@ -1505,7 +1505,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" }, @@ -1513,7 +1513,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "note" }, @@ -1521,15 +1521,15 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "note_url" }, { "type": { "simple": true, - "cardinality": "scalar", - "name": "@todo" + "cardinality": "list", + "name": "string" }, "name": "scopes" }, @@ -1537,7 +1537,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "token" }, @@ -1545,7 +1545,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "updated_at" }, @@ -1553,7 +1553,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "url" } @@ -2013,7 +2013,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "additions" }, @@ -2021,7 +2021,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "blob_url" }, @@ -2029,7 +2029,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "changes" }, @@ -2037,7 +2037,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "deletions" }, @@ -2045,7 +2045,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "filename" }, @@ -2053,7 +2053,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "patch" }, @@ -2061,7 +2061,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "raw_url" }, @@ -2069,7 +2069,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "sha" }, @@ -2077,7 +2077,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "status" } @@ -2123,7 +2123,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "accesskeyid" }, @@ -2131,7 +2131,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "acl" }, @@ -2139,7 +2139,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "bucket" }, @@ -2147,7 +2147,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "content_type" }, @@ -2155,7 +2155,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "created_at" }, @@ -2163,7 +2163,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "description" }, @@ -2171,7 +2171,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "download_count" }, @@ -2179,7 +2179,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "expirationdate" }, @@ -2187,7 +2187,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "html_url" }, @@ -2195,7 +2195,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" }, @@ -2203,7 +2203,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "mime_type" }, @@ -2211,7 +2211,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "name" }, @@ -2219,7 +2219,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "path" }, @@ -2227,7 +2227,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "policy" }, @@ -2235,7 +2235,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "prefix" }, @@ -2243,7 +2243,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "bool" }, "name": "redirect" }, @@ -2251,7 +2251,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "s3_url" }, @@ -2259,7 +2259,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "signature" }, @@ -2267,7 +2267,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "size" }, @@ -2275,7 +2275,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "url" } @@ -2325,7 +2325,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "created_at" }, @@ -2333,7 +2333,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "id" }, @@ -2357,7 +2357,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "bool" }, "name": "public" }, @@ -2373,7 +2373,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "type" } @@ -2822,7 +2822,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "body" }, @@ -2830,7 +2830,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "created_at" }, @@ -2838,7 +2838,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" }, @@ -2846,7 +2846,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "updated_at" }, @@ -2854,7 +2854,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "url" }, @@ -3403,7 +3403,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "bool" }, "name": "active" }, @@ -3419,15 +3419,15 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "created_at" }, { "type": { "simple": true, - "cardinality": "scalar", - "name": "@todo" + "cardinality": "list", + "name": "string" }, "name": "events" }, @@ -3435,7 +3435,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" }, @@ -3451,7 +3451,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "name" }, @@ -3459,7 +3459,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "updated_at" }, @@ -3467,7 +3467,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "url" } @@ -4197,7 +4197,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "body" }, @@ -4205,7 +4205,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "created_at" }, @@ -4213,7 +4213,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" }, @@ -4221,7 +4221,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "updated_at" }, @@ -4229,7 +4229,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "url" }, @@ -4378,7 +4378,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "color" }, @@ -4386,7 +4386,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "name" }, @@ -4394,7 +4394,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "url" } @@ -6445,7 +6445,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "additions" }, @@ -6461,7 +6461,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "body" }, @@ -6469,7 +6469,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "changed_files" }, @@ -6477,7 +6477,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "closed_at" }, @@ -6485,7 +6485,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "comments" }, @@ -6493,7 +6493,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "commits" }, @@ -6501,7 +6501,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "created_at" }, @@ -6509,7 +6509,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "deletions" }, @@ -6517,7 +6517,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "diff_url" }, @@ -6533,7 +6533,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "html_url" }, @@ -6541,7 +6541,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" }, @@ -6549,7 +6549,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "issue_url" }, @@ -6557,7 +6557,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "bool" }, "name": "mergeable" }, @@ -6565,7 +6565,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "bool" }, "name": "merged" }, @@ -6573,15 +6573,15 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "merged_at" }, { "type": { - "simple": true, + "simple": false, "cardinality": "scalar", - "name": "@todo" + "name": "NamedUser" }, "name": "merged_by" }, @@ -6589,7 +6589,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "number" }, @@ -6597,7 +6597,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "patch_url" }, @@ -6605,7 +6605,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "review_comments" }, @@ -6613,7 +6613,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "state" }, @@ -6621,7 +6621,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "title" }, @@ -6629,7 +6629,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "updated_at" }, @@ -6637,7 +6637,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "url" }, @@ -6997,7 +6997,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "body" }, @@ -7005,7 +7005,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "commit_id" }, @@ -7013,7 +7013,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "created_at" }, @@ -7021,7 +7021,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" }, @@ -7029,7 +7029,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "original_commit_id" }, @@ -7037,7 +7037,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "original_position" }, @@ -7045,7 +7045,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "path" }, @@ -7053,7 +7053,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "position" }, @@ -7061,7 +7061,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "updated_at" }, @@ -7069,7 +7069,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "url" }, @@ -7155,7 +7155,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "additions" }, @@ -7163,7 +7163,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "blob_url" }, @@ -7171,7 +7171,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "changes" }, @@ -7179,7 +7179,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "deletions" }, @@ -7187,7 +7187,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "filename" }, @@ -7195,7 +7195,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "patch" }, @@ -7203,7 +7203,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "raw_url" }, @@ -7211,7 +7211,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "sha" }, @@ -7219,7 +7219,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "status" } @@ -10080,7 +10080,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" }, @@ -10088,7 +10088,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "key" }, @@ -10096,7 +10096,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "title" }, @@ -10104,7 +10104,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "url" }, @@ -10237,7 +10237,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" }, @@ -10245,7 +10245,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "members_count" }, @@ -10253,7 +10253,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "name" }, @@ -10261,7 +10261,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "permission" }, @@ -10269,7 +10269,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "repos_count" }, @@ -10277,7 +10277,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "url" } @@ -10738,7 +10738,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "integer" }, "name": "id" }, @@ -10746,7 +10746,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "key" }, @@ -10754,7 +10754,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "title" }, @@ -10762,7 +10762,7 @@ "type": { "simple": true, "cardinality": "scalar", - "name": "@todo" + "name": "string" }, "name": "url" }, diff --git a/codegen/templates/GithubObject.py b/codegen/templates/GithubObject.py index 16ea8590..9bc9090b 100644 --- a/codegen/templates/GithubObject.py +++ b/codegen/templates/GithubObject.py @@ -71,38 +71,58 @@ class {{ class.name }}( object ): if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None: # pragma no branch {% if attribute.type.cardinality == "scalar" %} -{% if attribute.type.simple %} - {% if attribute.type.name == "string" %} - assert isinstance( attributes[ "{{ attribute.name }}" ], ( str, unicode ) ) - {% endif %} - {% if attribute.type.name == "integer" %} - assert isinstance( attributes[ "{{ attribute.name }}" ], int ) - {% endif %} - {% if attribute.type.name == "bool" %} - assert isinstance( attributes[ "{{ attribute.name }}" ], bool ) - {% endif %} -{% else %} - assert isinstance( attributes[ "{{ attribute.name }}" ], dict ) -{% endif %} -{% endif %} -{% if attribute.type.cardinality == "list" %} - assert isinstance( attributes[ "{{ attribute.name }}" ], list ) and ( len( attributes[ "{{ attribute.name }}" ] ) == 0 or isinstance( attributes[ "{{ attribute.name }}" ][ 0 ], dict ) ) + {% if attribute.type.simple %} + {% if attribute.type.name == "string" %} + assert isinstance( attributes[ "{{ attribute.name }}" ], ( str, unicode ) ), attributes[ "{{ attribute.name }}" ] + {% endif %} + {% if attribute.type.name == "integer" %} + assert isinstance( attributes[ "{{ attribute.name }}" ], int ), attributes[ "{{ attribute.name }}" ] + {% endif %} + {% if attribute.type.name == "bool" %} + assert isinstance( attributes[ "{{ attribute.name }}" ], bool ), attributes[ "{{ attribute.name }}" ] + {% endif %} + {% else %} + assert isinstance( attributes[ "{{ attribute.name }}" ], dict ), attributes[ "{{ attribute.name }}" ] + {% endif %} + +{% else %} + + {% if attribute.type.simple %} + {% if attribute.type.name == "string" %} + assert isinstance( attributes[ "{{ attribute.name }}" ], list ) and ( len( attributes[ "{{ attribute.name }}" ] ) == 0 or isinstance( attributes[ "{{ attribute.name }}" ][ 0 ], ( str, unicode ) ) ), attributes[ "{{ attribute.name }}" ] + {% endif %} + {% if attribute.type.name == "integer" %} + assert isinstance( attributes[ "{{ attribute.name }}" ], list ) and ( len( attributes[ "{{ attribute.name }}" ] ) == 0 or isinstance( attributes[ "{{ attribute.name }}" ][ 0 ], int ) ), attributes[ "{{ attribute.name }}" ] + {% endif %} + {% if attribute.type.name == "bool" %} + assert isinstance( attributes[ "{{ attribute.name }}" ], list ) and ( len( attributes[ "{{ attribute.name }}" ] ) == 0 or isinstance( attributes[ "{{ attribute.name }}" ][ 0 ], bool ) ), attributes[ "{{ attribute.name }}" ] + {% endif %} + {% else %} + assert isinstance( attributes[ "{{ attribute.name }}" ], list ) and ( len( attributes[ "{{ attribute.name }}" ] ) == 0 or isinstance( attributes[ "{{ attribute.name }}" ][ 0 ], dict ) ), attributes[ "{{ attribute.name }}" ] + {% endif %} + {% endif %} {% if attribute.type.cardinality == "scalar" %} -{% if attribute.type.simple %} - self.__{{ attribute.name }} = attributes[ "{{ attribute.name }}" ] -{% else %} - self.__{{ attribute.name }} = {% if attribute.type.name != class.name %}{{ attribute.type.name }}.{% endif %}{{ attribute.type.name }}( self.__requester, attributes[ "{{ attribute.name }}" ], completion = LazyCompletion ) -{% endif %} -{% endif %} -{% if attribute.type.cardinality == "list" %} + {% if attribute.type.simple %} + self.__{{ attribute.name }} = attributes[ "{{ attribute.name }}" ] + {% else %} + self.__{{ attribute.name }} = {% if attribute.type.name != class.name %}{{ attribute.type.name }}.{% endif %}{{ attribute.type.name }}( self.__requester, attributes[ "{{ attribute.name }}" ], completion = LazyCompletion ) + {% endif %} + +{% else %} + + {% if attribute.type.simple %} + self.__{{ attribute.name }} = attributes[ "{{ attribute.name }}" ] + {% else %} self.__{{ attribute.name }} = [ {% if attribute.type.name != class.name %}{{ attribute.type.name }}.{% endif %}{{ attribute.type.name }}( self.__requester, element, completion = LazyCompletion ) for element in attributes[ "{{ attribute.name }}" ] ] + {% endif %} + {% endif %} {% endfor %} diff --git a/doc/ReferenceOfClasses.md b/doc/ReferenceOfClasses.md index 9186bdd4..68b5a0f2 100644 --- a/doc/ReferenceOfClasses.md +++ b/doc/ReferenceOfClasses.md @@ -152,14 +152,14 @@ Class `Authorization` Attributes ---------- * `app` -* `created_at` -* `id` -* `note` -* `note_url` -* `scopes` -* `token` -* `updated_at` -* `url` +* `created_at`: string +* `id`: integer +* `note`: string +* `note_url`: string +* `scopes`: list of string +* `token`: string +* `updated_at`: string +* `url`: string Deletion -------- @@ -236,15 +236,15 @@ Class `CommitFile` Attributes ---------- -* `additions` -* `blob_url` -* `changes` -* `deletions` -* `filename` -* `patch` -* `raw_url` -* `sha` -* `status` +* `additions`: integer +* `blob_url`: string +* `changes`: integer +* `deletions`: integer +* `filename`: string +* `patch`: string +* `raw_url`: string +* `sha`: string +* `status`: string Class `CommitStats` =================== @@ -260,26 +260,26 @@ Class `Download` Attributes ---------- -* `accesskeyid` -* `acl` -* `bucket` -* `content_type` -* `created_at` -* `description` -* `download_count` -* `expirationdate` -* `html_url` -* `id` -* `mime_type` -* `name` -* `path` -* `policy` -* `prefix` -* `redirect` -* `s3_url` -* `signature` -* `size` -* `url` +* `accesskeyid`: string +* `acl`: string +* `bucket`: string +* `content_type`: string +* `created_at`: string +* `description`: string +* `download_count`: integer +* `expirationdate`: string +* `html_url`: string +* `id`: integer +* `mime_type`: string +* `name`: string +* `path`: string +* `policy`: string +* `prefix`: string +* `redirect`: bool +* `s3_url`: string +* `signature`: string +* `size`: integer +* `url`: string Deletion -------- @@ -291,13 +291,13 @@ Class `Event` Attributes ---------- * `actor`: `NamedUser` -* `created_at` -* `id` +* `created_at`: string +* `id`: string * `org`: `Organization` * `payload` -* `public` +* `public`: bool * `repo`: `Repository` -* `type` +* `type`: string Class `Gist` ============ @@ -353,11 +353,11 @@ Class `GistComment` Attributes ---------- -* `body` -* `created_at` -* `id` -* `updated_at` -* `url` +* `body`: string +* `created_at`: string +* `id`: integer +* `updated_at`: string +* `url`: string * `user`: `NamedUser` Deletion @@ -479,15 +479,15 @@ Class `Hook` Attributes ---------- -* `active` +* `active`: bool * `config` -* `created_at` -* `events` -* `id` +* `created_at`: string +* `events`: list of string +* `id`: integer * `last_response` -* `name` -* `updated_at` -* `url` +* `name`: string +* `updated_at`: string +* `url`: string Deletion -------- @@ -569,11 +569,11 @@ Class `IssueComment` Attributes ---------- -* `body` -* `created_at` -* `id` -* `updated_at` -* `url` +* `body`: string +* `created_at`: string +* `id`: integer +* `updated_at`: string +* `url`: string * `user`: `NamedUser` Deletion @@ -603,9 +603,9 @@ Class `Label` Attributes ---------- -* `color` -* `name` -* `url` +* `color`: string +* `name`: string +* `url`: string Deletion -------- @@ -837,31 +837,31 @@ Class `PullRequest` Attributes ---------- -* `additions` +* `additions`: integer * `base` -* `body` -* `changed_files` -* `closed_at` -* `comments` -* `commits` -* `created_at` -* `deletions` -* `diff_url` +* `body`: string +* `changed_files`: integer +* `closed_at`: string +* `comments`: integer +* `commits`: integer +* `created_at`: string +* `deletions`: integer +* `diff_url`: string * `head` -* `html_url` -* `id` -* `issue_url` -* `mergeable` -* `merged` -* `merged_at` -* `merged_by` -* `number` -* `patch_url` -* `review_comments` -* `state` -* `title` -* `updated_at` -* `url` +* `html_url`: string +* `id`: integer +* `issue_url`: string +* `mergeable`: bool +* `merged`: bool +* `merged_at`: string +* `merged_by`: `NamedUser` +* `number`: integer +* `patch_url`: string +* `review_comments`: integer +* `state`: string +* `title`: string +* `updated_at`: string +* `url`: string * `user`: `NamedUser` Comments @@ -901,16 +901,16 @@ Class `PullRequestComment` Attributes ---------- -* `body` -* `commit_id` -* `created_at` -* `id` -* `original_commit_id` -* `original_position` -* `path` -* `position` -* `updated_at` -* `url` +* `body`: string +* `commit_id`: string +* `created_at`: string +* `id`: integer +* `original_commit_id`: string +* `original_position`: integer +* `path`: string +* `position`: integer +* `updated_at`: string +* `url`: string * `user`: `NamedUser` Deletion @@ -927,15 +927,15 @@ Class `PullRequestFile` Attributes ---------- -* `additions` -* `blob_url` -* `changes` -* `deletions` -* `filename` -* `patch` -* `raw_url` -* `sha` -* `status` +* `additions`: integer +* `blob_url`: string +* `changes`: integer +* `deletions`: integer +* `filename`: string +* `patch`: string +* `raw_url`: string +* `sha`: string +* `status`: string Class `Repository` ================== @@ -1193,10 +1193,10 @@ Class `RepositoryKey` Attributes ---------- -* `id` -* `key` -* `title` -* `url` +* `id`: integer +* `key`: string +* `title`: string +* `url`: string * `verified`: bool Deletion @@ -1224,12 +1224,12 @@ Class `Team` Attributes ---------- -* `id` -* `members_count` -* `name` -* `permission` -* `repos_count` -* `url` +* `id`: integer +* `members_count`: integer +* `name`: string +* `permission`: string +* `repos_count`: integer +* `url`: string Deletion -------- @@ -1266,10 +1266,10 @@ Class `UserKey` Attributes ---------- -* `id` -* `key` -* `title` -* `url` +* `id`: integer +* `key`: string +* `title`: string +* `url`: string * `verified`: bool Deletion diff --git a/src/github/AuthenticatedUser.py b/src/github/AuthenticatedUser.py index 1bfdf4ea..a39a0501 100644 --- a/src/github/AuthenticatedUser.py +++ b/src/github/AuthenticatedUser.py @@ -565,77 +565,77 @@ class AuthenticatedUser( object ): def __useAttributes( self, attributes ): if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) ), attributes[ "avatar_url" ] self.__avatar_url = attributes[ "avatar_url" ] if "bio" in attributes and attributes[ "bio" ] is not None: # pragma no branch - assert isinstance( attributes[ "bio" ], ( str, unicode ) ) + assert isinstance( attributes[ "bio" ], ( str, unicode ) ), attributes[ "bio" ] self.__bio = attributes[ "bio" ] if "blog" in attributes and attributes[ "blog" ] is not None: # pragma no branch - assert isinstance( attributes[ "blog" ], ( str, unicode ) ) + assert isinstance( attributes[ "blog" ], ( str, unicode ) ), attributes[ "blog" ] self.__blog = attributes[ "blog" ] if "collaborators" in attributes and attributes[ "collaborators" ] is not None: # pragma no branch - assert isinstance( attributes[ "collaborators" ], int ) + assert isinstance( attributes[ "collaborators" ], int ), attributes[ "collaborators" ] self.__collaborators = attributes[ "collaborators" ] if "company" in attributes and attributes[ "company" ] is not None: # pragma no branch - assert isinstance( attributes[ "company" ], ( str, unicode ) ) + assert isinstance( attributes[ "company" ], ( str, unicode ) ), attributes[ "company" ] self.__company = attributes[ "company" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "created_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "disk_usage" in attributes and attributes[ "disk_usage" ] is not None: # pragma no branch - assert isinstance( attributes[ "disk_usage" ], int ) + assert isinstance( attributes[ "disk_usage" ], int ), attributes[ "disk_usage" ] self.__disk_usage = attributes[ "disk_usage" ] if "email" in attributes and attributes[ "email" ] is not None: # pragma no branch - assert isinstance( attributes[ "email" ], ( str, unicode ) ) + assert isinstance( attributes[ "email" ], ( str, unicode ) ), attributes[ "email" ] self.__email = attributes[ "email" ] if "followers" in attributes and attributes[ "followers" ] is not None: # pragma no branch - assert isinstance( attributes[ "followers" ], int ) + assert isinstance( attributes[ "followers" ], int ), attributes[ "followers" ] self.__followers = attributes[ "followers" ] if "following" in attributes and attributes[ "following" ] is not None: # pragma no branch - assert isinstance( attributes[ "following" ], int ) + assert isinstance( attributes[ "following" ], int ), attributes[ "following" ] self.__following = attributes[ "following" ] if "gravatar_id" in attributes and attributes[ "gravatar_id" ] is not None: # pragma no branch - assert isinstance( attributes[ "gravatar_id" ], ( str, unicode ) ) + assert isinstance( attributes[ "gravatar_id" ], ( str, unicode ) ), attributes[ "gravatar_id" ] self.__gravatar_id = attributes[ "gravatar_id" ] if "hireable" in attributes and attributes[ "hireable" ] is not None: # pragma no branch - assert isinstance( attributes[ "hireable" ], bool ) + assert isinstance( attributes[ "hireable" ], bool ), attributes[ "hireable" ] self.__hireable = attributes[ "hireable" ] if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "html_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] self.__html_url = attributes[ "html_url" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch - assert isinstance( attributes[ "id" ], int ) + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "location" in attributes and attributes[ "location" ] is not None: # pragma no branch - assert isinstance( attributes[ "location" ], ( str, unicode ) ) + assert isinstance( attributes[ "location" ], ( str, unicode ) ), attributes[ "location" ] self.__location = attributes[ "location" ] if "login" in attributes and attributes[ "login" ] is not None: # pragma no branch - assert isinstance( attributes[ "login" ], ( str, unicode ) ) + assert isinstance( attributes[ "login" ], ( str, unicode ) ), attributes[ "login" ] self.__login = attributes[ "login" ] if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch - assert isinstance( attributes[ "name" ], ( str, unicode ) ) + assert isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] self.__name = attributes[ "name" ] if "owned_private_repos" in attributes and attributes[ "owned_private_repos" ] is not None: # pragma no branch - assert isinstance( attributes[ "owned_private_repos" ], int ) + assert isinstance( attributes[ "owned_private_repos" ], int ), attributes[ "owned_private_repos" ] self.__owned_private_repos = attributes[ "owned_private_repos" ] if "plan" in attributes and attributes[ "plan" ] is not None: # pragma no branch - assert isinstance( attributes[ "plan" ], dict ) + assert isinstance( attributes[ "plan" ], dict ), attributes[ "plan" ] self.__plan = Plan.Plan( self.__requester, attributes[ "plan" ], completion = LazyCompletion ) if "private_gists" in attributes and attributes[ "private_gists" ] is not None: # pragma no branch - assert isinstance( attributes[ "private_gists" ], int ) + assert isinstance( attributes[ "private_gists" ], int ), attributes[ "private_gists" ] self.__private_gists = attributes[ "private_gists" ] if "public_gists" in attributes and attributes[ "public_gists" ] is not None: # pragma no branch - assert isinstance( attributes[ "public_gists" ], int ) + assert isinstance( attributes[ "public_gists" ], int ), attributes[ "public_gists" ] self.__public_gists = attributes[ "public_gists" ] if "public_repos" in attributes and attributes[ "public_repos" ] is not None: # pragma no branch - assert isinstance( attributes[ "public_repos" ], int ) + assert isinstance( attributes[ "public_repos" ], int ), attributes[ "public_repos" ] self.__public_repos = attributes[ "public_repos" ] if "total_private_repos" in attributes and attributes[ "total_private_repos" ] is not None: # pragma no branch - assert isinstance( attributes[ "total_private_repos" ], int ) + assert isinstance( attributes[ "total_private_repos" ], int ), attributes[ "total_private_repos" ] self.__total_private_repos = attributes[ "total_private_repos" ] if "type" in attributes and attributes[ "type" ] is not None: # pragma no branch - assert isinstance( attributes[ "type" ], ( str, unicode ) ) + assert isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ] self.__type = attributes[ "type" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/Authorization.py b/src/github/Authorization.py index 9a1d7b46..4eefd25a 100644 --- a/src/github/Authorization.py +++ b/src/github/Authorization.py @@ -116,18 +116,26 @@ class Authorization( object ): if "app" in attributes and attributes[ "app" ] is not None: # pragma no branch self.__app = attributes[ "app" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "note" in attributes and attributes[ "note" ] is not None: # pragma no branch + assert isinstance( attributes[ "note" ], ( str, unicode ) ), attributes[ "note" ] self.__note = attributes[ "note" ] if "note_url" in attributes and attributes[ "note_url" ] is not None: # pragma no branch + assert isinstance( attributes[ "note_url" ], ( str, unicode ) ), attributes[ "note_url" ] self.__note_url = attributes[ "note_url" ] if "scopes" in attributes and attributes[ "scopes" ] is not None: # pragma no branch + assert isinstance( attributes[ "scopes" ], list ) and ( len( attributes[ "scopes" ] ) == 0 or isinstance( attributes[ "scopes" ][ 0 ], ( str, unicode ) ) ), attributes[ "scopes" ] self.__scopes = attributes[ "scopes" ] if "token" in attributes and attributes[ "token" ] is not None: # pragma no branch + assert isinstance( attributes[ "token" ], ( str, unicode ) ), attributes[ "token" ] self.__token = attributes[ "token" ] if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] self.__updated_at = attributes[ "updated_at" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/Branch.py b/src/github/Branch.py index 28562f7e..30c7ff0c 100644 --- a/src/github/Branch.py +++ b/src/github/Branch.py @@ -25,8 +25,8 @@ class Branch( object ): def __useAttributes( self, attributes ): if "commit" in attributes and attributes[ "commit" ] is not None: # pragma no branch - assert isinstance( attributes[ "commit" ], dict ) + assert isinstance( attributes[ "commit" ], dict ), attributes[ "commit" ] self.__commit = Commit.Commit( self.__requester, attributes[ "commit" ], completion = LazyCompletion ) if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch - assert isinstance( attributes[ "name" ], ( str, unicode ) ) + assert isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] self.__name = attributes[ "name" ] diff --git a/src/github/Commit.py b/src/github/Commit.py index a3046870..15457962 100644 --- a/src/github/Commit.py +++ b/src/github/Commit.py @@ -117,32 +117,32 @@ class Commit( object ): def __useAttributes( self, attributes ): if "author" in attributes and attributes[ "author" ] is not None: # pragma no branch - assert isinstance( attributes[ "author" ], dict ) + assert isinstance( attributes[ "author" ], dict ), attributes[ "author" ] self.__author = NamedUser.NamedUser( self.__requester, attributes[ "author" ], completion = LazyCompletion ) if "commit" in attributes and attributes[ "commit" ] is not None: # pragma no branch - assert isinstance( attributes[ "commit" ], dict ) + assert isinstance( attributes[ "commit" ], dict ), attributes[ "commit" ] self.__commit = GitCommit.GitCommit( self.__requester, attributes[ "commit" ], completion = LazyCompletion ) if "committer" in attributes and attributes[ "committer" ] is not None: # pragma no branch - assert isinstance( attributes[ "committer" ], dict ) + assert isinstance( attributes[ "committer" ], dict ), attributes[ "committer" ] self.__committer = NamedUser.NamedUser( self.__requester, attributes[ "committer" ], completion = LazyCompletion ) if "files" in attributes and attributes[ "files" ] is not None: # pragma no branch - assert isinstance( attributes[ "files" ], list ) and ( len( attributes[ "files" ] ) == 0 or isinstance( attributes[ "files" ][ 0 ], dict ) ) + assert isinstance( attributes[ "files" ], list ) and ( len( attributes[ "files" ] ) == 0 or isinstance( attributes[ "files" ][ 0 ], dict ) ), attributes[ "files" ] self.__files = [ CommitFile.CommitFile( self.__requester, element, completion = LazyCompletion ) for element in attributes[ "files" ] ] if "parents" in attributes and attributes[ "parents" ] is not None: # pragma no branch - assert isinstance( attributes[ "parents" ], list ) and ( len( attributes[ "parents" ] ) == 0 or isinstance( attributes[ "parents" ][ 0 ], dict ) ) + assert isinstance( attributes[ "parents" ], list ) and ( len( attributes[ "parents" ] ) == 0 or isinstance( attributes[ "parents" ][ 0 ], dict ) ), attributes[ "parents" ] self.__parents = [ Commit( self.__requester, element, completion = LazyCompletion ) for element in attributes[ "parents" ] ] if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch - assert isinstance( attributes[ "sha" ], ( str, unicode ) ) + assert isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] self.__sha = attributes[ "sha" ] if "stats" in attributes and attributes[ "stats" ] is not None: # pragma no branch - assert isinstance( attributes[ "stats" ], dict ) + assert isinstance( attributes[ "stats" ], dict ), attributes[ "stats" ] self.__stats = CommitStats.CommitStats( self.__requester, attributes[ "stats" ], completion = LazyCompletion ) if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/CommitComment.py b/src/github/CommitComment.py index 669578ec..455f72c1 100644 --- a/src/github/CommitComment.py +++ b/src/github/CommitComment.py @@ -118,35 +118,35 @@ class CommitComment( object ): def __useAttributes( self, attributes ): if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch - assert isinstance( attributes[ "body" ], ( str, unicode ) ) + assert isinstance( attributes[ "body" ], ( str, unicode ) ), attributes[ "body" ] self.__body = attributes[ "body" ] if "commit_id" in attributes and attributes[ "commit_id" ] is not None: # pragma no branch - assert isinstance( attributes[ "commit_id" ], ( str, unicode ) ) + assert isinstance( attributes[ "commit_id" ], ( str, unicode ) ), attributes[ "commit_id" ] self.__commit_id = attributes[ "commit_id" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "created_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "html_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] self.__html_url = attributes[ "html_url" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch - assert isinstance( attributes[ "id" ], int ) + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "line" in attributes and attributes[ "line" ] is not None: # pragma no branch - assert isinstance( attributes[ "line" ], int ) + assert isinstance( attributes[ "line" ], int ), attributes[ "line" ] self.__line = attributes[ "line" ] if "path" in attributes and attributes[ "path" ] is not None: # pragma no branch - assert isinstance( attributes[ "path" ], ( str, unicode ) ) + assert isinstance( attributes[ "path" ], ( str, unicode ) ), attributes[ "path" ] self.__path = attributes[ "path" ] if "position" in attributes and attributes[ "position" ] is not None: # pragma no branch - assert isinstance( attributes[ "position" ], int ) + assert isinstance( attributes[ "position" ], int ), attributes[ "position" ] self.__position = attributes[ "position" ] if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] self.__updated_at = attributes[ "updated_at" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch - assert isinstance( attributes[ "user" ], dict ) + assert isinstance( attributes[ "user" ], dict ), attributes[ "user" ] self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion ) diff --git a/src/github/CommitFile.py b/src/github/CommitFile.py index d512e408..8f65e5d9 100644 --- a/src/github/CommitFile.py +++ b/src/github/CommitFile.py @@ -59,20 +59,29 @@ class CommitFile( object ): def __useAttributes( self, attributes ): if "additions" in attributes and attributes[ "additions" ] is not None: # pragma no branch + assert isinstance( attributes[ "additions" ], int ), attributes[ "additions" ] self.__additions = attributes[ "additions" ] if "blob_url" in attributes and attributes[ "blob_url" ] is not None: # pragma no branch + assert isinstance( attributes[ "blob_url" ], ( str, unicode ) ), attributes[ "blob_url" ] self.__blob_url = attributes[ "blob_url" ] if "changes" in attributes and attributes[ "changes" ] is not None: # pragma no branch + assert isinstance( attributes[ "changes" ], int ), attributes[ "changes" ] self.__changes = attributes[ "changes" ] if "deletions" in attributes and attributes[ "deletions" ] is not None: # pragma no branch + assert isinstance( attributes[ "deletions" ], int ), attributes[ "deletions" ] self.__deletions = attributes[ "deletions" ] if "filename" in attributes and attributes[ "filename" ] is not None: # pragma no branch + assert isinstance( attributes[ "filename" ], ( str, unicode ) ), attributes[ "filename" ] self.__filename = attributes[ "filename" ] if "patch" in attributes and attributes[ "patch" ] is not None: # pragma no branch + assert isinstance( attributes[ "patch" ], ( str, unicode ) ), attributes[ "patch" ] self.__patch = attributes[ "patch" ] if "raw_url" in attributes and attributes[ "raw_url" ] is not None: # pragma no branch + assert isinstance( attributes[ "raw_url" ], ( str, unicode ) ), attributes[ "raw_url" ] self.__raw_url = attributes[ "raw_url" ] if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch + assert isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] self.__sha = attributes[ "sha" ] if "status" in attributes and attributes[ "status" ] is not None: # pragma no branch + assert isinstance( attributes[ "status" ], ( str, unicode ) ), attributes[ "status" ] self.__status = attributes[ "status" ] diff --git a/src/github/CommitStats.py b/src/github/CommitStats.py index 2a7a4727..27ea7be5 100644 --- a/src/github/CommitStats.py +++ b/src/github/CommitStats.py @@ -29,11 +29,11 @@ class CommitStats( object ): def __useAttributes( self, attributes ): if "additions" in attributes and attributes[ "additions" ] is not None: # pragma no branch - assert isinstance( attributes[ "additions" ], int ) + assert isinstance( attributes[ "additions" ], int ), attributes[ "additions" ] self.__additions = attributes[ "additions" ] if "deletions" in attributes and attributes[ "deletions" ] is not None: # pragma no branch - assert isinstance( attributes[ "deletions" ], int ) + assert isinstance( attributes[ "deletions" ], int ), attributes[ "deletions" ] self.__deletions = attributes[ "deletions" ] if "total" in attributes and attributes[ "total" ] is not None: # pragma no branch - assert isinstance( attributes[ "total" ], int ) + assert isinstance( attributes[ "total" ], int ), attributes[ "total" ] self.__total = attributes[ "total" ] diff --git a/src/github/Download.py b/src/github/Download.py index 342e3094..be312f1f 100644 --- a/src/github/Download.py +++ b/src/github/Download.py @@ -159,42 +159,62 @@ class Download( object ): def __useAttributes( self, attributes ): if "accesskeyid" in attributes and attributes[ "accesskeyid" ] is not None: # pragma no branch + assert isinstance( attributes[ "accesskeyid" ], ( str, unicode ) ), attributes[ "accesskeyid" ] self.__accesskeyid = attributes[ "accesskeyid" ] if "acl" in attributes and attributes[ "acl" ] is not None: # pragma no branch + assert isinstance( attributes[ "acl" ], ( str, unicode ) ), attributes[ "acl" ] self.__acl = attributes[ "acl" ] if "bucket" in attributes and attributes[ "bucket" ] is not None: # pragma no branch + assert isinstance( attributes[ "bucket" ], ( str, unicode ) ), attributes[ "bucket" ] self.__bucket = attributes[ "bucket" ] if "content_type" in attributes and attributes[ "content_type" ] is not None: # pragma no branch + assert isinstance( attributes[ "content_type" ], ( str, unicode ) ), attributes[ "content_type" ] self.__content_type = attributes[ "content_type" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "description" in attributes and attributes[ "description" ] is not None: # pragma no branch + assert isinstance( attributes[ "description" ], ( str, unicode ) ), attributes[ "description" ] self.__description = attributes[ "description" ] if "download_count" in attributes and attributes[ "download_count" ] is not None: # pragma no branch + assert isinstance( attributes[ "download_count" ], int ), attributes[ "download_count" ] self.__download_count = attributes[ "download_count" ] if "expirationdate" in attributes and attributes[ "expirationdate" ] is not None: # pragma no branch + assert isinstance( attributes[ "expirationdate" ], ( str, unicode ) ), attributes[ "expirationdate" ] self.__expirationdate = attributes[ "expirationdate" ] if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch + assert isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] self.__html_url = attributes[ "html_url" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "mime_type" in attributes and attributes[ "mime_type" ] is not None: # pragma no branch + assert isinstance( attributes[ "mime_type" ], ( str, unicode ) ), attributes[ "mime_type" ] self.__mime_type = attributes[ "mime_type" ] if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch + assert isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] self.__name = attributes[ "name" ] if "path" in attributes and attributes[ "path" ] is not None: # pragma no branch + assert isinstance( attributes[ "path" ], ( str, unicode ) ), attributes[ "path" ] self.__path = attributes[ "path" ] if "policy" in attributes and attributes[ "policy" ] is not None: # pragma no branch + assert isinstance( attributes[ "policy" ], ( str, unicode ) ), attributes[ "policy" ] self.__policy = attributes[ "policy" ] if "prefix" in attributes and attributes[ "prefix" ] is not None: # pragma no branch + assert isinstance( attributes[ "prefix" ], ( str, unicode ) ), attributes[ "prefix" ] self.__prefix = attributes[ "prefix" ] if "redirect" in attributes and attributes[ "redirect" ] is not None: # pragma no branch + assert isinstance( attributes[ "redirect" ], bool ), attributes[ "redirect" ] self.__redirect = attributes[ "redirect" ] if "s3_url" in attributes and attributes[ "s3_url" ] is not None: # pragma no branch + assert isinstance( attributes[ "s3_url" ], ( str, unicode ) ), attributes[ "s3_url" ] self.__s3_url = attributes[ "s3_url" ] if "signature" in attributes and attributes[ "signature" ] is not None: # pragma no branch + assert isinstance( attributes[ "signature" ], ( str, unicode ) ), attributes[ "signature" ] self.__signature = attributes[ "signature" ] if "size" in attributes and attributes[ "size" ] is not None: # pragma no branch + assert isinstance( attributes[ "size" ], int ), attributes[ "size" ] self.__size = attributes[ "size" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/Event.py b/src/github/Event.py index 19a9e1af..10082fed 100644 --- a/src/github/Event.py +++ b/src/github/Event.py @@ -57,21 +57,25 @@ class Event( object ): def __useAttributes( self, attributes ): if "actor" in attributes and attributes[ "actor" ] is not None: # pragma no branch - assert isinstance( attributes[ "actor" ], dict ) + assert isinstance( attributes[ "actor" ], dict ), attributes[ "actor" ] self.__actor = NamedUser.NamedUser( self.__requester, attributes[ "actor" ], completion = LazyCompletion ) if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch + assert isinstance( attributes[ "id" ], ( str, unicode ) ), attributes[ "id" ] self.__id = attributes[ "id" ] if "org" in attributes and attributes[ "org" ] is not None: # pragma no branch - assert isinstance( attributes[ "org" ], dict ) + assert isinstance( attributes[ "org" ], dict ), attributes[ "org" ] self.__org = Organization.Organization( self.__requester, attributes[ "org" ], completion = LazyCompletion ) if "payload" in attributes and attributes[ "payload" ] is not None: # pragma no branch self.__payload = attributes[ "payload" ] if "public" in attributes and attributes[ "public" ] is not None: # pragma no branch + assert isinstance( attributes[ "public" ], bool ), attributes[ "public" ] self.__public = attributes[ "public" ] if "repo" in attributes and attributes[ "repo" ] is not None: # pragma no branch - assert isinstance( attributes[ "repo" ], dict ) + assert isinstance( attributes[ "repo" ], dict ), attributes[ "repo" ] self.__repo = Repository.Repository( self.__requester, attributes[ "repo" ], completion = LazyCompletion ) if "type" in attributes and attributes[ "type" ] is not None: # pragma no branch + assert isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ] self.__type = attributes[ "type" ] diff --git a/src/github/Gist.py b/src/github/Gist.py index 81bd9b74..cfa4912d 100644 --- a/src/github/Gist.py +++ b/src/github/Gist.py @@ -217,52 +217,52 @@ class Gist( object ): def __useAttributes( self, attributes ): if "comments" in attributes and attributes[ "comments" ] is not None: # pragma no branch - assert isinstance( attributes[ "comments" ], int ) + assert isinstance( attributes[ "comments" ], int ), attributes[ "comments" ] self.__comments = attributes[ "comments" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "created_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "description" in attributes and attributes[ "description" ] is not None: # pragma no branch - assert isinstance( attributes[ "description" ], ( str, unicode ) ) + assert isinstance( attributes[ "description" ], ( str, unicode ) ), attributes[ "description" ] self.__description = attributes[ "description" ] if "files" in attributes and attributes[ "files" ] is not None: # pragma no branch self.__files = attributes[ "files" ] if "fork_of" in attributes and attributes[ "fork_of" ] is not None: # pragma no branch - assert isinstance( attributes[ "fork_of" ], dict ) + assert isinstance( attributes[ "fork_of" ], dict ), attributes[ "fork_of" ] self.__fork_of = Gist( self.__requester, attributes[ "fork_of" ], completion = LazyCompletion ) if "forks" in attributes and attributes[ "forks" ] is not None: # pragma no branch - assert isinstance( attributes[ "forks" ], list ) and ( len( attributes[ "forks" ] ) == 0 or isinstance( attributes[ "forks" ][ 0 ], dict ) ) + assert isinstance( attributes[ "forks" ], list ) and ( len( attributes[ "forks" ] ) == 0 or isinstance( attributes[ "forks" ][ 0 ], dict ) ), attributes[ "forks" ] self.__forks = [ Gist( self.__requester, element, completion = LazyCompletion ) for element in attributes[ "forks" ] ] if "git_pull_url" in attributes and attributes[ "git_pull_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "git_pull_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "git_pull_url" ], ( str, unicode ) ), attributes[ "git_pull_url" ] self.__git_pull_url = attributes[ "git_pull_url" ] if "git_push_url" in attributes and attributes[ "git_push_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "git_push_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "git_push_url" ], ( str, unicode ) ), attributes[ "git_push_url" ] self.__git_push_url = attributes[ "git_push_url" ] if "history" in attributes and attributes[ "history" ] is not None: # pragma no branch - assert isinstance( attributes[ "history" ], list ) and ( len( attributes[ "history" ] ) == 0 or isinstance( attributes[ "history" ][ 0 ], dict ) ) + assert isinstance( attributes[ "history" ], list ) and ( len( attributes[ "history" ] ) == 0 or isinstance( attributes[ "history" ][ 0 ], dict ) ), attributes[ "history" ] self.__history = [ GistHistoryState.GistHistoryState( self.__requester, element, completion = LazyCompletion ) for element in attributes[ "history" ] ] if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "html_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] self.__html_url = attributes[ "html_url" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch - assert isinstance( attributes[ "id" ], ( str, unicode ) ) + assert isinstance( attributes[ "id" ], ( str, unicode ) ), attributes[ "id" ] self.__id = attributes[ "id" ] if "public" in attributes and attributes[ "public" ] is not None: # pragma no branch - assert isinstance( attributes[ "public" ], bool ) + assert isinstance( attributes[ "public" ], bool ), attributes[ "public" ] self.__public = attributes[ "public" ] if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] self.__updated_at = attributes[ "updated_at" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch - assert isinstance( attributes[ "user" ], dict ) + assert isinstance( attributes[ "user" ], dict ), attributes[ "user" ] self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion ) diff --git a/src/github/GistComment.py b/src/github/GistComment.py index 5af4f71e..04cfdd50 100644 --- a/src/github/GistComment.py +++ b/src/github/GistComment.py @@ -65,15 +65,20 @@ class GistComment( object ): def __useAttributes( self, attributes ): if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch + assert isinstance( attributes[ "body" ], ( str, unicode ) ), attributes[ "body" ] self.__body = attributes[ "body" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] self.__updated_at = attributes[ "updated_at" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch - assert isinstance( attributes[ "user" ], dict ) + assert isinstance( attributes[ "user" ], dict ), attributes[ "user" ] self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion ) diff --git a/src/github/GistHistoryState.py b/src/github/GistHistoryState.py index 6e39b7ff..10f7f52a 100644 --- a/src/github/GistHistoryState.py +++ b/src/github/GistHistoryState.py @@ -41,17 +41,17 @@ class GistHistoryState( object ): def __useAttributes( self, attributes ): if "change_status" in attributes and attributes[ "change_status" ] is not None: # pragma no branch - assert isinstance( attributes[ "change_status" ], dict ) + assert isinstance( attributes[ "change_status" ], dict ), attributes[ "change_status" ] self.__change_status = CommitStats.CommitStats( self.__requester, attributes[ "change_status" ], completion = LazyCompletion ) if "committed_at" in attributes and attributes[ "committed_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "committed_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "committed_at" ], ( str, unicode ) ), attributes[ "committed_at" ] self.__committed_at = attributes[ "committed_at" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch - assert isinstance( attributes[ "user" ], dict ) + assert isinstance( attributes[ "user" ], dict ), attributes[ "user" ] self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion ) if "version" in attributes and attributes[ "version" ] is not None: # pragma no branch - assert isinstance( attributes[ "version" ], ( str, unicode ) ) + assert isinstance( attributes[ "version" ], ( str, unicode ) ), attributes[ "version" ] self.__version = attributes[ "version" ] diff --git a/src/github/GitAuthor.py b/src/github/GitAuthor.py index 024c380c..2773103d 100644 --- a/src/github/GitAuthor.py +++ b/src/github/GitAuthor.py @@ -29,11 +29,11 @@ class GitAuthor( object ): def __useAttributes( self, attributes ): if "date" in attributes and attributes[ "date" ] is not None: # pragma no branch - assert isinstance( attributes[ "date" ], ( str, unicode ) ) + assert isinstance( attributes[ "date" ], ( str, unicode ) ), attributes[ "date" ] self.__date = attributes[ "date" ] if "email" in attributes and attributes[ "email" ] is not None: # pragma no branch - assert isinstance( attributes[ "email" ], ( str, unicode ) ) + assert isinstance( attributes[ "email" ], ( str, unicode ) ), attributes[ "email" ] self.__email = attributes[ "email" ] if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch - assert isinstance( attributes[ "name" ], ( str, unicode ) ) + assert isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] self.__name = attributes[ "name" ] diff --git a/src/github/GitBlob.py b/src/github/GitBlob.py index e6d686e2..b8028661 100644 --- a/src/github/GitBlob.py +++ b/src/github/GitBlob.py @@ -39,17 +39,17 @@ class GitBlob( object ): def __useAttributes( self, attributes ): if "content" in attributes and attributes[ "content" ] is not None: # pragma no branch - assert isinstance( attributes[ "content" ], ( str, unicode ) ) + assert isinstance( attributes[ "content" ], ( str, unicode ) ), attributes[ "content" ] self.__content = attributes[ "content" ] if "encoding" in attributes and attributes[ "encoding" ] is not None: # pragma no branch - assert isinstance( attributes[ "encoding" ], ( str, unicode ) ) + assert isinstance( attributes[ "encoding" ], ( str, unicode ) ), attributes[ "encoding" ] self.__encoding = attributes[ "encoding" ] if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch - assert isinstance( attributes[ "sha" ], ( str, unicode ) ) + assert isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] self.__sha = attributes[ "sha" ] if "size" in attributes and attributes[ "size" ] is not None: # pragma no branch - assert isinstance( attributes[ "size" ], int ) + assert isinstance( attributes[ "size" ], int ), attributes[ "size" ] self.__size = attributes[ "size" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/GitCommit.py b/src/github/GitCommit.py index 2b100ca9..873d06d4 100644 --- a/src/github/GitCommit.py +++ b/src/github/GitCommit.py @@ -52,26 +52,26 @@ class GitCommit( object ): def __useAttributes( self, attributes ): if "author" in attributes and attributes[ "author" ] is not None: # pragma no branch - assert isinstance( attributes[ "author" ], dict ) + assert isinstance( attributes[ "author" ], dict ), attributes[ "author" ] self.__author = GitAuthor.GitAuthor( self.__requester, attributes[ "author" ], completion = LazyCompletion ) if "committer" in attributes and attributes[ "committer" ] is not None: # pragma no branch - assert isinstance( attributes[ "committer" ], dict ) + assert isinstance( attributes[ "committer" ], dict ), attributes[ "committer" ] self.__committer = GitAuthor.GitAuthor( self.__requester, attributes[ "committer" ], completion = LazyCompletion ) if "message" in attributes and attributes[ "message" ] is not None: # pragma no branch - assert isinstance( attributes[ "message" ], ( str, unicode ) ) + assert isinstance( attributes[ "message" ], ( str, unicode ) ), attributes[ "message" ] self.__message = attributes[ "message" ] if "parents" in attributes and attributes[ "parents" ] is not None: # pragma no branch - assert isinstance( attributes[ "parents" ], list ) and ( len( attributes[ "parents" ] ) == 0 or isinstance( attributes[ "parents" ][ 0 ], dict ) ) + assert isinstance( attributes[ "parents" ], list ) and ( len( attributes[ "parents" ] ) == 0 or isinstance( attributes[ "parents" ][ 0 ], dict ) ), attributes[ "parents" ] self.__parents = [ GitCommit( self.__requester, element, completion = LazyCompletion ) for element in attributes[ "parents" ] ] if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch - assert isinstance( attributes[ "sha" ], ( str, unicode ) ) + assert isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] self.__sha = attributes[ "sha" ] if "tree" in attributes and attributes[ "tree" ] is not None: # pragma no branch - assert isinstance( attributes[ "tree" ], dict ) + assert isinstance( attributes[ "tree" ], dict ), attributes[ "tree" ] self.__tree = GitTree.GitTree( self.__requester, attributes[ "tree" ], completion = LazyCompletion ) if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/GitObject.py b/src/github/GitObject.py index ac7e3b41..70845aea 100644 --- a/src/github/GitObject.py +++ b/src/github/GitObject.py @@ -29,11 +29,11 @@ class GitObject( object ): def __useAttributes( self, attributes ): if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch - assert isinstance( attributes[ "sha" ], ( str, unicode ) ) + assert isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] self.__sha = attributes[ "sha" ] if "type" in attributes and attributes[ "type" ] is not None: # pragma no branch - assert isinstance( attributes[ "type" ], ( str, unicode ) ) + assert isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ] self.__type = attributes[ "type" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/GitRef.py b/src/github/GitRef.py index 8d449e1b..3dd733fa 100644 --- a/src/github/GitRef.py +++ b/src/github/GitRef.py @@ -52,11 +52,11 @@ class GitRef( object ): def __useAttributes( self, attributes ): if "object" in attributes and attributes[ "object" ] is not None: # pragma no branch - assert isinstance( attributes[ "object" ], dict ) + assert isinstance( attributes[ "object" ], dict ), attributes[ "object" ] self.__object = GitObject.GitObject( self.__requester, attributes[ "object" ], completion = LazyCompletion ) if "ref" in attributes and attributes[ "ref" ] is not None: # pragma no branch - assert isinstance( attributes[ "ref" ], ( str, unicode ) ) + assert isinstance( attributes[ "ref" ], ( str, unicode ) ), attributes[ "ref" ] self.__ref = attributes[ "ref" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/GitTag.py b/src/github/GitTag.py index caa95bc0..f315e92f 100644 --- a/src/github/GitTag.py +++ b/src/github/GitTag.py @@ -46,20 +46,20 @@ class GitTag( object ): def __useAttributes( self, attributes ): if "message" in attributes and attributes[ "message" ] is not None: # pragma no branch - assert isinstance( attributes[ "message" ], ( str, unicode ) ) + assert isinstance( attributes[ "message" ], ( str, unicode ) ), attributes[ "message" ] self.__message = attributes[ "message" ] if "object" in attributes and attributes[ "object" ] is not None: # pragma no branch - assert isinstance( attributes[ "object" ], dict ) + assert isinstance( attributes[ "object" ], dict ), attributes[ "object" ] self.__object = GitObject.GitObject( self.__requester, attributes[ "object" ], completion = LazyCompletion ) if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch - assert isinstance( attributes[ "sha" ], ( str, unicode ) ) + assert isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] self.__sha = attributes[ "sha" ] if "tag" in attributes and attributes[ "tag" ] is not None: # pragma no branch - assert isinstance( attributes[ "tag" ], ( str, unicode ) ) + assert isinstance( attributes[ "tag" ], ( str, unicode ) ), attributes[ "tag" ] self.__tag = attributes[ "tag" ] if "tagger" in attributes and attributes[ "tagger" ] is not None: # pragma no branch - assert isinstance( attributes[ "tagger" ], dict ) + assert isinstance( attributes[ "tagger" ], dict ), attributes[ "tagger" ] self.__tagger = GitAuthor.GitAuthor( self.__requester, attributes[ "tagger" ], completion = LazyCompletion ) if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/GitTree.py b/src/github/GitTree.py index a60bb204..4e7a6485 100644 --- a/src/github/GitTree.py +++ b/src/github/GitTree.py @@ -30,14 +30,14 @@ class GitTree( object ): def __useAttributes( self, attributes ): if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch - assert isinstance( attributes[ "sha" ], ( str, unicode ) ) + assert isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] self.__sha = attributes[ "sha" ] if "tree" in attributes and attributes[ "tree" ] is not None: # pragma no branch - assert isinstance( attributes[ "tree" ], list ) and ( len( attributes[ "tree" ] ) == 0 or isinstance( attributes[ "tree" ][ 0 ], dict ) ) + assert isinstance( attributes[ "tree" ], list ) and ( len( attributes[ "tree" ] ) == 0 or isinstance( attributes[ "tree" ][ 0 ], dict ) ), attributes[ "tree" ] self.__tree = [ GitTreeElement.GitTreeElement( self.__requester, element, completion = LazyCompletion ) for element in attributes[ "tree" ] ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/GitTreeElement.py b/src/github/GitTreeElement.py index 85782925..8639ebb0 100644 --- a/src/github/GitTreeElement.py +++ b/src/github/GitTreeElement.py @@ -44,20 +44,20 @@ class GitTreeElement( object ): def __useAttributes( self, attributes ): if "mode" in attributes and attributes[ "mode" ] is not None: # pragma no branch - assert isinstance( attributes[ "mode" ], ( str, unicode ) ) + assert isinstance( attributes[ "mode" ], ( str, unicode ) ), attributes[ "mode" ] self.__mode = attributes[ "mode" ] if "path" in attributes and attributes[ "path" ] is not None: # pragma no branch - assert isinstance( attributes[ "path" ], ( str, unicode ) ) + assert isinstance( attributes[ "path" ], ( str, unicode ) ), attributes[ "path" ] self.__path = attributes[ "path" ] if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch - assert isinstance( attributes[ "sha" ], ( str, unicode ) ) + assert isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] self.__sha = attributes[ "sha" ] if "size" in attributes and attributes[ "size" ] is not None: # pragma no branch - assert isinstance( attributes[ "size" ], int ) + assert isinstance( attributes[ "size" ], int ), attributes[ "size" ] self.__size = attributes[ "size" ] if "type" in attributes and attributes[ "type" ] is not None: # pragma no branch - assert isinstance( attributes[ "type" ], ( str, unicode ) ) + assert isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ] self.__type = attributes[ "type" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/Hook.py b/src/github/Hook.py index 4d099db2..83c6e6b8 100644 --- a/src/github/Hook.py +++ b/src/github/Hook.py @@ -96,20 +96,27 @@ class Hook( object ): def __useAttributes( self, attributes ): if "active" in attributes and attributes[ "active" ] is not None: # pragma no branch + assert isinstance( attributes[ "active" ], bool ), attributes[ "active" ] self.__active = attributes[ "active" ] if "config" in attributes and attributes[ "config" ] is not None: # pragma no branch self.__config = attributes[ "config" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "events" in attributes and attributes[ "events" ] is not None: # pragma no branch + assert isinstance( attributes[ "events" ], list ) and ( len( attributes[ "events" ] ) == 0 or isinstance( attributes[ "events" ][ 0 ], ( str, unicode ) ) ), attributes[ "events" ] self.__events = attributes[ "events" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "last_response" in attributes and attributes[ "last_response" ] is not None: # pragma no branch self.__last_response = attributes[ "last_response" ] if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch + assert isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] self.__name = attributes[ "name" ] if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] self.__updated_at = attributes[ "updated_at" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/Issue.py b/src/github/Issue.py index c9996fea..ad2e6a49 100644 --- a/src/github/Issue.py +++ b/src/github/Issue.py @@ -265,58 +265,58 @@ class Issue( object ): def __useAttributes( self, attributes ): if "assignee" in attributes and attributes[ "assignee" ] is not None: # pragma no branch - assert isinstance( attributes[ "assignee" ], dict ) + assert isinstance( attributes[ "assignee" ], dict ), attributes[ "assignee" ] self.__assignee = NamedUser.NamedUser( self.__requester, attributes[ "assignee" ], completion = LazyCompletion ) if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch - assert isinstance( attributes[ "body" ], ( str, unicode ) ) + assert isinstance( attributes[ "body" ], ( str, unicode ) ), attributes[ "body" ] self.__body = attributes[ "body" ] if "closed_at" in attributes and attributes[ "closed_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "closed_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "closed_at" ], ( str, unicode ) ), attributes[ "closed_at" ] self.__closed_at = attributes[ "closed_at" ] if "closed_by" in attributes and attributes[ "closed_by" ] is not None: # pragma no branch - assert isinstance( attributes[ "closed_by" ], dict ) + assert isinstance( attributes[ "closed_by" ], dict ), attributes[ "closed_by" ] self.__closed_by = NamedUser.NamedUser( self.__requester, attributes[ "closed_by" ], completion = LazyCompletion ) if "comments" in attributes and attributes[ "comments" ] is not None: # pragma no branch - assert isinstance( attributes[ "comments" ], int ) + assert isinstance( attributes[ "comments" ], int ), attributes[ "comments" ] self.__comments = attributes[ "comments" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "created_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "html_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] self.__html_url = attributes[ "html_url" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch - assert isinstance( attributes[ "id" ], int ) + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "labels" in attributes and attributes[ "labels" ] is not None: # pragma no branch - assert isinstance( attributes[ "labels" ], list ) and ( len( attributes[ "labels" ] ) == 0 or isinstance( attributes[ "labels" ][ 0 ], dict ) ) + assert isinstance( attributes[ "labels" ], list ) and ( len( attributes[ "labels" ] ) == 0 or isinstance( attributes[ "labels" ][ 0 ], dict ) ), attributes[ "labels" ] self.__labels = [ Label.Label( self.__requester, element, completion = LazyCompletion ) for element in attributes[ "labels" ] ] if "milestone" in attributes and attributes[ "milestone" ] is not None: # pragma no branch - assert isinstance( attributes[ "milestone" ], dict ) + assert isinstance( attributes[ "milestone" ], dict ), attributes[ "milestone" ] self.__milestone = Milestone.Milestone( self.__requester, attributes[ "milestone" ], completion = LazyCompletion ) if "number" in attributes and attributes[ "number" ] is not None: # pragma no branch - assert isinstance( attributes[ "number" ], int ) + assert isinstance( attributes[ "number" ], int ), attributes[ "number" ] self.__number = attributes[ "number" ] if "pull_request" in attributes and attributes[ "pull_request" ] is not None: # pragma no branch self.__pull_request = attributes[ "pull_request" ] if "repository" in attributes and attributes[ "repository" ] is not None: # pragma no branch - assert isinstance( attributes[ "repository" ], dict ) + assert isinstance( attributes[ "repository" ], dict ), attributes[ "repository" ] self.__repository = Repository.Repository( self.__requester, attributes[ "repository" ], completion = LazyCompletion ) if "state" in attributes and attributes[ "state" ] is not None: # pragma no branch - assert isinstance( attributes[ "state" ], ( str, unicode ) ) + assert isinstance( attributes[ "state" ], ( str, unicode ) ), attributes[ "state" ] self.__state = attributes[ "state" ] if "title" in attributes and attributes[ "title" ] is not None: # pragma no branch - assert isinstance( attributes[ "title" ], ( str, unicode ) ) + assert isinstance( attributes[ "title" ], ( str, unicode ) ), attributes[ "title" ] self.__title = attributes[ "title" ] if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] self.__updated_at = attributes[ "updated_at" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch - assert isinstance( attributes[ "user" ], dict ) + assert isinstance( attributes[ "user" ], dict ), attributes[ "user" ] self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion ) diff --git a/src/github/IssueComment.py b/src/github/IssueComment.py index 5d198891..b197ef74 100644 --- a/src/github/IssueComment.py +++ b/src/github/IssueComment.py @@ -65,15 +65,20 @@ class IssueComment( object ): def __useAttributes( self, attributes ): if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch + assert isinstance( attributes[ "body" ], ( str, unicode ) ), attributes[ "body" ] self.__body = attributes[ "body" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] self.__updated_at = attributes[ "updated_at" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch - assert isinstance( attributes[ "user" ], dict ) + assert isinstance( attributes[ "user" ], dict ), attributes[ "user" ] self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion ) diff --git a/src/github/IssueEvent.py b/src/github/IssueEvent.py index cd9103f0..fafd9140 100644 --- a/src/github/IssueEvent.py +++ b/src/github/IssueEvent.py @@ -75,23 +75,23 @@ class IssueEvent( object ): def __useAttributes( self, attributes ): if "actor" in attributes and attributes[ "actor" ] is not None: # pragma no branch - assert isinstance( attributes[ "actor" ], dict ) + assert isinstance( attributes[ "actor" ], dict ), attributes[ "actor" ] self.__actor = NamedUser.NamedUser( self.__requester, attributes[ "actor" ], completion = LazyCompletion ) if "commit_id" in attributes and attributes[ "commit_id" ] is not None: # pragma no branch - assert isinstance( attributes[ "commit_id" ], ( str, unicode ) ) + assert isinstance( attributes[ "commit_id" ], ( str, unicode ) ), attributes[ "commit_id" ] self.__commit_id = attributes[ "commit_id" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "created_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "event" in attributes and attributes[ "event" ] is not None: # pragma no branch - assert isinstance( attributes[ "event" ], ( str, unicode ) ) + assert isinstance( attributes[ "event" ], ( str, unicode ) ), attributes[ "event" ] self.__event = attributes[ "event" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch - assert isinstance( attributes[ "id" ], int ) + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "issue" in attributes and attributes[ "issue" ] is not None: # pragma no branch - assert isinstance( attributes[ "issue" ], dict ) + assert isinstance( attributes[ "issue" ], dict ), attributes[ "issue" ] self.__issue = Issue.Issue( self.__requester, attributes[ "issue" ], completion = LazyCompletion ) if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/Label.py b/src/github/Label.py index 7f4d467b..bc365e55 100644 --- a/src/github/Label.py +++ b/src/github/Label.py @@ -55,8 +55,11 @@ class Label( object ): def __useAttributes( self, attributes ): if "color" in attributes and attributes[ "color" ] is not None: # pragma no branch + assert isinstance( attributes[ "color" ], ( str, unicode ) ), attributes[ "color" ] self.__color = attributes[ "color" ] if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch + assert isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] self.__name = attributes[ "name" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/Milestone.py b/src/github/Milestone.py index 90c3a58f..9679bf09 100644 --- a/src/github/Milestone.py +++ b/src/github/Milestone.py @@ -111,35 +111,35 @@ class Milestone( object ): def __useAttributes( self, attributes ): if "closed_issues" in attributes and attributes[ "closed_issues" ] is not None: # pragma no branch - assert isinstance( attributes[ "closed_issues" ], int ) + assert isinstance( attributes[ "closed_issues" ], int ), attributes[ "closed_issues" ] self.__closed_issues = attributes[ "closed_issues" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "created_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "creator" in attributes and attributes[ "creator" ] is not None: # pragma no branch - assert isinstance( attributes[ "creator" ], dict ) + assert isinstance( attributes[ "creator" ], dict ), attributes[ "creator" ] self.__creator = NamedUser.NamedUser( self.__requester, attributes[ "creator" ], completion = LazyCompletion ) if "description" in attributes and attributes[ "description" ] is not None: # pragma no branch - assert isinstance( attributes[ "description" ], ( str, unicode ) ) + assert isinstance( attributes[ "description" ], ( str, unicode ) ), attributes[ "description" ] self.__description = attributes[ "description" ] if "due_on" in attributes and attributes[ "due_on" ] is not None: # pragma no branch - assert isinstance( attributes[ "due_on" ], ( str, unicode ) ) + assert isinstance( attributes[ "due_on" ], ( str, unicode ) ), attributes[ "due_on" ] self.__due_on = attributes[ "due_on" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch - assert isinstance( attributes[ "id" ], int ) + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "number" in attributes and attributes[ "number" ] is not None: # pragma no branch - assert isinstance( attributes[ "number" ], int ) + assert isinstance( attributes[ "number" ], int ), attributes[ "number" ] self.__number = attributes[ "number" ] if "open_issues" in attributes and attributes[ "open_issues" ] is not None: # pragma no branch - assert isinstance( attributes[ "open_issues" ], int ) + assert isinstance( attributes[ "open_issues" ], int ), attributes[ "open_issues" ] self.__open_issues = attributes[ "open_issues" ] if "state" in attributes and attributes[ "state" ] is not None: # pragma no branch - assert isinstance( attributes[ "state" ], ( str, unicode ) ) + assert isinstance( attributes[ "state" ], ( str, unicode ) ), attributes[ "state" ] self.__state = attributes[ "state" ] if "title" in attributes and attributes[ "title" ] is not None: # pragma no branch - assert isinstance( attributes[ "title" ], ( str, unicode ) ) + assert isinstance( attributes[ "title" ], ( str, unicode ) ), attributes[ "title" ] self.__title = attributes[ "title" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/NamedUser.py b/src/github/NamedUser.py index 3f19c68d..08846bfd 100644 --- a/src/github/NamedUser.py +++ b/src/github/NamedUser.py @@ -361,80 +361,80 @@ class NamedUser( object ): def __useAttributes( self, attributes ): if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) ), attributes[ "avatar_url" ] self.__avatar_url = attributes[ "avatar_url" ] if "bio" in attributes and attributes[ "bio" ] is not None: # pragma no branch - assert isinstance( attributes[ "bio" ], ( str, unicode ) ) + assert isinstance( attributes[ "bio" ], ( str, unicode ) ), attributes[ "bio" ] self.__bio = attributes[ "bio" ] if "blog" in attributes and attributes[ "blog" ] is not None: # pragma no branch - assert isinstance( attributes[ "blog" ], ( str, unicode ) ) + assert isinstance( attributes[ "blog" ], ( str, unicode ) ), attributes[ "blog" ] self.__blog = attributes[ "blog" ] if "collaborators" in attributes and attributes[ "collaborators" ] is not None: # pragma no branch - assert isinstance( attributes[ "collaborators" ], int ) + assert isinstance( attributes[ "collaborators" ], int ), attributes[ "collaborators" ] self.__collaborators = attributes[ "collaborators" ] if "company" in attributes and attributes[ "company" ] is not None: # pragma no branch - assert isinstance( attributes[ "company" ], ( str, unicode ) ) + assert isinstance( attributes[ "company" ], ( str, unicode ) ), attributes[ "company" ] self.__company = attributes[ "company" ] if "contributions" in attributes and attributes[ "contributions" ] is not None: # pragma no branch - assert isinstance( attributes[ "contributions" ], int ) + assert isinstance( attributes[ "contributions" ], int ), attributes[ "contributions" ] self.__contributions = attributes[ "contributions" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "created_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "disk_usage" in attributes and attributes[ "disk_usage" ] is not None: # pragma no branch - assert isinstance( attributes[ "disk_usage" ], int ) + assert isinstance( attributes[ "disk_usage" ], int ), attributes[ "disk_usage" ] self.__disk_usage = attributes[ "disk_usage" ] if "email" in attributes and attributes[ "email" ] is not None: # pragma no branch - assert isinstance( attributes[ "email" ], ( str, unicode ) ) + assert isinstance( attributes[ "email" ], ( str, unicode ) ), attributes[ "email" ] self.__email = attributes[ "email" ] if "followers" in attributes and attributes[ "followers" ] is not None: # pragma no branch - assert isinstance( attributes[ "followers" ], int ) + assert isinstance( attributes[ "followers" ], int ), attributes[ "followers" ] self.__followers = attributes[ "followers" ] if "following" in attributes and attributes[ "following" ] is not None: # pragma no branch - assert isinstance( attributes[ "following" ], int ) + assert isinstance( attributes[ "following" ], int ), attributes[ "following" ] self.__following = attributes[ "following" ] if "gravatar_id" in attributes and attributes[ "gravatar_id" ] is not None: # pragma no branch - assert isinstance( attributes[ "gravatar_id" ], ( str, unicode ) ) + assert isinstance( attributes[ "gravatar_id" ], ( str, unicode ) ), attributes[ "gravatar_id" ] self.__gravatar_id = attributes[ "gravatar_id" ] if "hireable" in attributes and attributes[ "hireable" ] is not None: # pragma no branch - assert isinstance( attributes[ "hireable" ], bool ) + assert isinstance( attributes[ "hireable" ], bool ), attributes[ "hireable" ] self.__hireable = attributes[ "hireable" ] if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "html_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] self.__html_url = attributes[ "html_url" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch - assert isinstance( attributes[ "id" ], int ) + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "location" in attributes and attributes[ "location" ] is not None: # pragma no branch - assert isinstance( attributes[ "location" ], ( str, unicode ) ) + assert isinstance( attributes[ "location" ], ( str, unicode ) ), attributes[ "location" ] self.__location = attributes[ "location" ] if "login" in attributes and attributes[ "login" ] is not None: # pragma no branch - assert isinstance( attributes[ "login" ], ( str, unicode ) ) + assert isinstance( attributes[ "login" ], ( str, unicode ) ), attributes[ "login" ] self.__login = attributes[ "login" ] if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch - assert isinstance( attributes[ "name" ], ( str, unicode ) ) + assert isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] self.__name = attributes[ "name" ] if "owned_private_repos" in attributes and attributes[ "owned_private_repos" ] is not None: # pragma no branch - assert isinstance( attributes[ "owned_private_repos" ], int ) + assert isinstance( attributes[ "owned_private_repos" ], int ), attributes[ "owned_private_repos" ] self.__owned_private_repos = attributes[ "owned_private_repos" ] if "plan" in attributes and attributes[ "plan" ] is not None: # pragma no branch - assert isinstance( attributes[ "plan" ], dict ) + assert isinstance( attributes[ "plan" ], dict ), attributes[ "plan" ] self.__plan = Plan.Plan( self.__requester, attributes[ "plan" ], completion = LazyCompletion ) if "private_gists" in attributes and attributes[ "private_gists" ] is not None: # pragma no branch - assert isinstance( attributes[ "private_gists" ], int ) + assert isinstance( attributes[ "private_gists" ], int ), attributes[ "private_gists" ] self.__private_gists = attributes[ "private_gists" ] if "public_gists" in attributes and attributes[ "public_gists" ] is not None: # pragma no branch - assert isinstance( attributes[ "public_gists" ], int ) + assert isinstance( attributes[ "public_gists" ], int ), attributes[ "public_gists" ] self.__public_gists = attributes[ "public_gists" ] if "public_repos" in attributes and attributes[ "public_repos" ] is not None: # pragma no branch - assert isinstance( attributes[ "public_repos" ], int ) + assert isinstance( attributes[ "public_repos" ], int ), attributes[ "public_repos" ] self.__public_repos = attributes[ "public_repos" ] if "total_private_repos" in attributes and attributes[ "total_private_repos" ] is not None: # pragma no branch - assert isinstance( attributes[ "total_private_repos" ], int ) + assert isinstance( attributes[ "total_private_repos" ], int ), attributes[ "total_private_repos" ] self.__total_private_repos = attributes[ "total_private_repos" ] if "type" in attributes and attributes[ "type" ] is not None: # pragma no branch - assert isinstance( attributes[ "type" ], ( str, unicode ) ) + assert isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ] self.__type = attributes[ "type" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/Organization.py b/src/github/Organization.py index febd06ef..11d54fd0 100644 --- a/src/github/Organization.py +++ b/src/github/Organization.py @@ -387,74 +387,74 @@ class Organization( object ): def __useAttributes( self, attributes ): if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) ), attributes[ "avatar_url" ] self.__avatar_url = attributes[ "avatar_url" ] if "billing_email" in attributes and attributes[ "billing_email" ] is not None: # pragma no branch - assert isinstance( attributes[ "billing_email" ], ( str, unicode ) ) + assert isinstance( attributes[ "billing_email" ], ( str, unicode ) ), attributes[ "billing_email" ] self.__billing_email = attributes[ "billing_email" ] if "blog" in attributes and attributes[ "blog" ] is not None: # pragma no branch - assert isinstance( attributes[ "blog" ], ( str, unicode ) ) + assert isinstance( attributes[ "blog" ], ( str, unicode ) ), attributes[ "blog" ] self.__blog = attributes[ "blog" ] if "collaborators" in attributes and attributes[ "collaborators" ] is not None: # pragma no branch - assert isinstance( attributes[ "collaborators" ], int ) + assert isinstance( attributes[ "collaborators" ], int ), attributes[ "collaborators" ] self.__collaborators = attributes[ "collaborators" ] if "company" in attributes and attributes[ "company" ] is not None: # pragma no branch - assert isinstance( attributes[ "company" ], ( str, unicode ) ) + assert isinstance( attributes[ "company" ], ( str, unicode ) ), attributes[ "company" ] self.__company = attributes[ "company" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "created_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "disk_usage" in attributes and attributes[ "disk_usage" ] is not None: # pragma no branch - assert isinstance( attributes[ "disk_usage" ], int ) + assert isinstance( attributes[ "disk_usage" ], int ), attributes[ "disk_usage" ] self.__disk_usage = attributes[ "disk_usage" ] if "email" in attributes and attributes[ "email" ] is not None: # pragma no branch - assert isinstance( attributes[ "email" ], ( str, unicode ) ) + assert isinstance( attributes[ "email" ], ( str, unicode ) ), attributes[ "email" ] self.__email = attributes[ "email" ] if "followers" in attributes and attributes[ "followers" ] is not None: # pragma no branch - assert isinstance( attributes[ "followers" ], int ) + assert isinstance( attributes[ "followers" ], int ), attributes[ "followers" ] self.__followers = attributes[ "followers" ] if "following" in attributes and attributes[ "following" ] is not None: # pragma no branch - assert isinstance( attributes[ "following" ], int ) + assert isinstance( attributes[ "following" ], int ), attributes[ "following" ] self.__following = attributes[ "following" ] if "gravatar_id" in attributes and attributes[ "gravatar_id" ] is not None: # pragma no branch - assert isinstance( attributes[ "gravatar_id" ], ( str, unicode ) ) + assert isinstance( attributes[ "gravatar_id" ], ( str, unicode ) ), attributes[ "gravatar_id" ] self.__gravatar_id = attributes[ "gravatar_id" ] if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "html_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] self.__html_url = attributes[ "html_url" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch - assert isinstance( attributes[ "id" ], int ) + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "location" in attributes and attributes[ "location" ] is not None: # pragma no branch - assert isinstance( attributes[ "location" ], ( str, unicode ) ) + assert isinstance( attributes[ "location" ], ( str, unicode ) ), attributes[ "location" ] self.__location = attributes[ "location" ] if "login" in attributes and attributes[ "login" ] is not None: # pragma no branch - assert isinstance( attributes[ "login" ], ( str, unicode ) ) + assert isinstance( attributes[ "login" ], ( str, unicode ) ), attributes[ "login" ] self.__login = attributes[ "login" ] if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch - assert isinstance( attributes[ "name" ], ( str, unicode ) ) + assert isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] self.__name = attributes[ "name" ] if "owned_private_repos" in attributes and attributes[ "owned_private_repos" ] is not None: # pragma no branch - assert isinstance( attributes[ "owned_private_repos" ], int ) + assert isinstance( attributes[ "owned_private_repos" ], int ), attributes[ "owned_private_repos" ] self.__owned_private_repos = attributes[ "owned_private_repos" ] if "plan" in attributes and attributes[ "plan" ] is not None: # pragma no branch - assert isinstance( attributes[ "plan" ], dict ) + assert isinstance( attributes[ "plan" ], dict ), attributes[ "plan" ] self.__plan = Plan.Plan( self.__requester, attributes[ "plan" ], completion = LazyCompletion ) if "private_gists" in attributes and attributes[ "private_gists" ] is not None: # pragma no branch - assert isinstance( attributes[ "private_gists" ], int ) + assert isinstance( attributes[ "private_gists" ], int ), attributes[ "private_gists" ] self.__private_gists = attributes[ "private_gists" ] if "public_gists" in attributes and attributes[ "public_gists" ] is not None: # pragma no branch - assert isinstance( attributes[ "public_gists" ], int ) + assert isinstance( attributes[ "public_gists" ], int ), attributes[ "public_gists" ] self.__public_gists = attributes[ "public_gists" ] if "public_repos" in attributes and attributes[ "public_repos" ] is not None: # pragma no branch - assert isinstance( attributes[ "public_repos" ], int ) + assert isinstance( attributes[ "public_repos" ], int ), attributes[ "public_repos" ] self.__public_repos = attributes[ "public_repos" ] if "total_private_repos" in attributes and attributes[ "total_private_repos" ] is not None: # pragma no branch - assert isinstance( attributes[ "total_private_repos" ], int ) + assert isinstance( attributes[ "total_private_repos" ], int ), attributes[ "total_private_repos" ] self.__total_private_repos = attributes[ "total_private_repos" ] if "type" in attributes and attributes[ "type" ] is not None: # pragma no branch - assert isinstance( attributes[ "type" ], ( str, unicode ) ) + assert isinstance( attributes[ "type" ], ( str, unicode ) ), attributes[ "type" ] self.__type = attributes[ "type" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/Permissions.py b/src/github/Permissions.py index ec3b7efc..1dc1907a 100644 --- a/src/github/Permissions.py +++ b/src/github/Permissions.py @@ -29,11 +29,11 @@ class Permissions( object ): def __useAttributes( self, attributes ): if "admin" in attributes and attributes[ "admin" ] is not None: # pragma no branch - assert isinstance( attributes[ "admin" ], bool ) + assert isinstance( attributes[ "admin" ], bool ), attributes[ "admin" ] self.__admin = attributes[ "admin" ] if "pull" in attributes and attributes[ "pull" ] is not None: # pragma no branch - assert isinstance( attributes[ "pull" ], bool ) + assert isinstance( attributes[ "pull" ], bool ), attributes[ "pull" ] self.__pull = attributes[ "pull" ] if "push" in attributes and attributes[ "push" ] is not None: # pragma no branch - assert isinstance( attributes[ "push" ], bool ) + assert isinstance( attributes[ "push" ], bool ), attributes[ "push" ] self.__push = attributes[ "push" ] diff --git a/src/github/Plan.py b/src/github/Plan.py index fe874c44..9be47904 100644 --- a/src/github/Plan.py +++ b/src/github/Plan.py @@ -34,14 +34,14 @@ class Plan( object ): def __useAttributes( self, attributes ): if "collaborators" in attributes and attributes[ "collaborators" ] is not None: # pragma no branch - assert isinstance( attributes[ "collaborators" ], int ) + assert isinstance( attributes[ "collaborators" ], int ), attributes[ "collaborators" ] self.__collaborators = attributes[ "collaborators" ] if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch - assert isinstance( attributes[ "name" ], ( str, unicode ) ) + assert isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] self.__name = attributes[ "name" ] if "private_repos" in attributes and attributes[ "private_repos" ] is not None: # pragma no branch - assert isinstance( attributes[ "private_repos" ], int ) + assert isinstance( attributes[ "private_repos" ], int ), attributes[ "private_repos" ] self.__private_repos = attributes[ "private_repos" ] if "space" in attributes and attributes[ "space" ] is not None: # pragma no branch - assert isinstance( attributes[ "space" ], int ) + assert isinstance( attributes[ "space" ], int ), attributes[ "space" ] self.__space = attributes[ "space" ] diff --git a/src/github/PullRequest.py b/src/github/PullRequest.py index ab055b6f..d43db8be 100644 --- a/src/github/PullRequest.py +++ b/src/github/PullRequest.py @@ -295,55 +295,78 @@ class PullRequest( object ): def __useAttributes( self, attributes ): if "additions" in attributes and attributes[ "additions" ] is not None: # pragma no branch + assert isinstance( attributes[ "additions" ], int ), attributes[ "additions" ] self.__additions = attributes[ "additions" ] if "base" in attributes and attributes[ "base" ] is not None: # pragma no branch self.__base = attributes[ "base" ] if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch + assert isinstance( attributes[ "body" ], ( str, unicode ) ), attributes[ "body" ] self.__body = attributes[ "body" ] if "changed_files" in attributes and attributes[ "changed_files" ] is not None: # pragma no branch + assert isinstance( attributes[ "changed_files" ], int ), attributes[ "changed_files" ] self.__changed_files = attributes[ "changed_files" ] if "closed_at" in attributes and attributes[ "closed_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "closed_at" ], ( str, unicode ) ), attributes[ "closed_at" ] self.__closed_at = attributes[ "closed_at" ] if "comments" in attributes and attributes[ "comments" ] is not None: # pragma no branch + assert isinstance( attributes[ "comments" ], int ), attributes[ "comments" ] self.__comments = attributes[ "comments" ] if "commits" in attributes and attributes[ "commits" ] is not None: # pragma no branch + assert isinstance( attributes[ "commits" ], int ), attributes[ "commits" ] self.__commits = attributes[ "commits" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "deletions" in attributes and attributes[ "deletions" ] is not None: # pragma no branch + assert isinstance( attributes[ "deletions" ], int ), attributes[ "deletions" ] self.__deletions = attributes[ "deletions" ] if "diff_url" in attributes and attributes[ "diff_url" ] is not None: # pragma no branch + assert isinstance( attributes[ "diff_url" ], ( str, unicode ) ), attributes[ "diff_url" ] self.__diff_url = attributes[ "diff_url" ] if "head" in attributes and attributes[ "head" ] is not None: # pragma no branch self.__head = attributes[ "head" ] if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch + assert isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] self.__html_url = attributes[ "html_url" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "issue_url" in attributes and attributes[ "issue_url" ] is not None: # pragma no branch + assert isinstance( attributes[ "issue_url" ], ( str, unicode ) ), attributes[ "issue_url" ] self.__issue_url = attributes[ "issue_url" ] if "mergeable" in attributes and attributes[ "mergeable" ] is not None: # pragma no branch + assert isinstance( attributes[ "mergeable" ], bool ), attributes[ "mergeable" ] self.__mergeable = attributes[ "mergeable" ] if "merged" in attributes and attributes[ "merged" ] is not None: # pragma no branch + assert isinstance( attributes[ "merged" ], bool ), attributes[ "merged" ] self.__merged = attributes[ "merged" ] if "merged_at" in attributes and attributes[ "merged_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "merged_at" ], ( str, unicode ) ), attributes[ "merged_at" ] self.__merged_at = attributes[ "merged_at" ] if "merged_by" in attributes and attributes[ "merged_by" ] is not None: # pragma no branch - self.__merged_by = attributes[ "merged_by" ] + assert isinstance( attributes[ "merged_by" ], dict ), attributes[ "merged_by" ] + self.__merged_by = NamedUser.NamedUser( self.__requester, attributes[ "merged_by" ], completion = LazyCompletion ) if "number" in attributes and attributes[ "number" ] is not None: # pragma no branch + assert isinstance( attributes[ "number" ], int ), attributes[ "number" ] self.__number = attributes[ "number" ] if "patch_url" in attributes and attributes[ "patch_url" ] is not None: # pragma no branch + assert isinstance( attributes[ "patch_url" ], ( str, unicode ) ), attributes[ "patch_url" ] self.__patch_url = attributes[ "patch_url" ] if "review_comments" in attributes and attributes[ "review_comments" ] is not None: # pragma no branch + assert isinstance( attributes[ "review_comments" ], int ), attributes[ "review_comments" ] self.__review_comments = attributes[ "review_comments" ] if "state" in attributes and attributes[ "state" ] is not None: # pragma no branch + assert isinstance( attributes[ "state" ], ( str, unicode ) ), attributes[ "state" ] self.__state = attributes[ "state" ] if "title" in attributes and attributes[ "title" ] is not None: # pragma no branch + assert isinstance( attributes[ "title" ], ( str, unicode ) ), attributes[ "title" ] self.__title = attributes[ "title" ] if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] self.__updated_at = attributes[ "updated_at" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch - assert isinstance( attributes[ "user" ], dict ) + assert isinstance( attributes[ "user" ], dict ), attributes[ "user" ] self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion ) diff --git a/src/github/PullRequestComment.py b/src/github/PullRequestComment.py index 54483403..c7386e9d 100644 --- a/src/github/PullRequestComment.py +++ b/src/github/PullRequestComment.py @@ -118,25 +118,35 @@ class PullRequestComment( object ): def __useAttributes( self, attributes ): if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch + assert isinstance( attributes[ "body" ], ( str, unicode ) ), attributes[ "body" ] self.__body = attributes[ "body" ] if "commit_id" in attributes and attributes[ "commit_id" ] is not None: # pragma no branch + assert isinstance( attributes[ "commit_id" ], ( str, unicode ) ), attributes[ "commit_id" ] self.__commit_id = attributes[ "commit_id" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "original_commit_id" in attributes and attributes[ "original_commit_id" ] is not None: # pragma no branch + assert isinstance( attributes[ "original_commit_id" ], ( str, unicode ) ), attributes[ "original_commit_id" ] self.__original_commit_id = attributes[ "original_commit_id" ] if "original_position" in attributes and attributes[ "original_position" ] is not None: # pragma no branch + assert isinstance( attributes[ "original_position" ], int ), attributes[ "original_position" ] self.__original_position = attributes[ "original_position" ] if "path" in attributes and attributes[ "path" ] is not None: # pragma no branch + assert isinstance( attributes[ "path" ], ( str, unicode ) ), attributes[ "path" ] self.__path = attributes[ "path" ] if "position" in attributes and attributes[ "position" ] is not None: # pragma no branch + assert isinstance( attributes[ "position" ], int ), attributes[ "position" ] self.__position = attributes[ "position" ] if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch + assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] self.__updated_at = attributes[ "updated_at" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch - assert isinstance( attributes[ "user" ], dict ) + assert isinstance( attributes[ "user" ], dict ), attributes[ "user" ] self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion ) diff --git a/src/github/PullRequestFile.py b/src/github/PullRequestFile.py index 6395c614..96d9884b 100644 --- a/src/github/PullRequestFile.py +++ b/src/github/PullRequestFile.py @@ -59,20 +59,29 @@ class PullRequestFile( object ): def __useAttributes( self, attributes ): if "additions" in attributes and attributes[ "additions" ] is not None: # pragma no branch + assert isinstance( attributes[ "additions" ], int ), attributes[ "additions" ] self.__additions = attributes[ "additions" ] if "blob_url" in attributes and attributes[ "blob_url" ] is not None: # pragma no branch + assert isinstance( attributes[ "blob_url" ], ( str, unicode ) ), attributes[ "blob_url" ] self.__blob_url = attributes[ "blob_url" ] if "changes" in attributes and attributes[ "changes" ] is not None: # pragma no branch + assert isinstance( attributes[ "changes" ], int ), attributes[ "changes" ] self.__changes = attributes[ "changes" ] if "deletions" in attributes and attributes[ "deletions" ] is not None: # pragma no branch + assert isinstance( attributes[ "deletions" ], int ), attributes[ "deletions" ] self.__deletions = attributes[ "deletions" ] if "filename" in attributes and attributes[ "filename" ] is not None: # pragma no branch + assert isinstance( attributes[ "filename" ], ( str, unicode ) ), attributes[ "filename" ] self.__filename = attributes[ "filename" ] if "patch" in attributes and attributes[ "patch" ] is not None: # pragma no branch + assert isinstance( attributes[ "patch" ], ( str, unicode ) ), attributes[ "patch" ] self.__patch = attributes[ "patch" ] if "raw_url" in attributes and attributes[ "raw_url" ] is not None: # pragma no branch + assert isinstance( attributes[ "raw_url" ], ( str, unicode ) ), attributes[ "raw_url" ] self.__raw_url = attributes[ "raw_url" ] if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch + assert isinstance( attributes[ "sha" ], ( str, unicode ) ), attributes[ "sha" ] self.__sha = attributes[ "sha" ] if "status" in attributes and attributes[ "status" ] is not None: # pragma no branch + assert isinstance( attributes[ "status" ], ( str, unicode ) ), attributes[ "status" ] self.__status = attributes[ "status" ] diff --git a/src/github/Repository.py b/src/github/Repository.py index 0c926536..6418e532 100644 --- a/src/github/Repository.py +++ b/src/github/Repository.py @@ -916,92 +916,92 @@ class Repository( object ): def __useAttributes( self, attributes ): if "clone_url" in attributes and attributes[ "clone_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "clone_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "clone_url" ], ( str, unicode ) ), attributes[ "clone_url" ] self.__clone_url = attributes[ "clone_url" ] if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "created_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "created_at" ], ( str, unicode ) ), attributes[ "created_at" ] self.__created_at = attributes[ "created_at" ] if "description" in attributes and attributes[ "description" ] is not None: # pragma no branch - assert isinstance( attributes[ "description" ], ( str, unicode ) ) + assert isinstance( attributes[ "description" ], ( str, unicode ) ), attributes[ "description" ] self.__description = attributes[ "description" ] if "fork" in attributes and attributes[ "fork" ] is not None: # pragma no branch - assert isinstance( attributes[ "fork" ], bool ) + assert isinstance( attributes[ "fork" ], bool ), attributes[ "fork" ] self.__fork = attributes[ "fork" ] if "forks" in attributes and attributes[ "forks" ] is not None: # pragma no branch - assert isinstance( attributes[ "forks" ], int ) + assert isinstance( attributes[ "forks" ], int ), attributes[ "forks" ] self.__forks = attributes[ "forks" ] if "full_name" in attributes and attributes[ "full_name" ] is not None: # pragma no branch - assert isinstance( attributes[ "full_name" ], ( str, unicode ) ) + assert isinstance( attributes[ "full_name" ], ( str, unicode ) ), attributes[ "full_name" ] self.__full_name = attributes[ "full_name" ] if "git_url" in attributes and attributes[ "git_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "git_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "git_url" ], ( str, unicode ) ), attributes[ "git_url" ] self.__git_url = attributes[ "git_url" ] if "has_downloads" in attributes and attributes[ "has_downloads" ] is not None: # pragma no branch - assert isinstance( attributes[ "has_downloads" ], bool ) + assert isinstance( attributes[ "has_downloads" ], bool ), attributes[ "has_downloads" ] self.__has_downloads = attributes[ "has_downloads" ] if "has_issues" in attributes and attributes[ "has_issues" ] is not None: # pragma no branch - assert isinstance( attributes[ "has_issues" ], bool ) + assert isinstance( attributes[ "has_issues" ], bool ), attributes[ "has_issues" ] self.__has_issues = attributes[ "has_issues" ] if "has_wiki" in attributes and attributes[ "has_wiki" ] is not None: # pragma no branch - assert isinstance( attributes[ "has_wiki" ], bool ) + assert isinstance( attributes[ "has_wiki" ], bool ), attributes[ "has_wiki" ] self.__has_wiki = attributes[ "has_wiki" ] if "homepage" in attributes and attributes[ "homepage" ] is not None: # pragma no branch - assert isinstance( attributes[ "homepage" ], ( str, unicode ) ) + assert isinstance( attributes[ "homepage" ], ( str, unicode ) ), attributes[ "homepage" ] self.__homepage = attributes[ "homepage" ] if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "html_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "html_url" ], ( str, unicode ) ), attributes[ "html_url" ] self.__html_url = attributes[ "html_url" ] if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch - assert isinstance( attributes[ "id" ], int ) + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "language" in attributes and attributes[ "language" ] is not None: # pragma no branch - assert isinstance( attributes[ "language" ], ( str, unicode ) ) + assert isinstance( attributes[ "language" ], ( str, unicode ) ), attributes[ "language" ] self.__language = attributes[ "language" ] if "master_branch" in attributes and attributes[ "master_branch" ] is not None: # pragma no branch - assert isinstance( attributes[ "master_branch" ], ( str, unicode ) ) + assert isinstance( attributes[ "master_branch" ], ( str, unicode ) ), attributes[ "master_branch" ] self.__master_branch = attributes[ "master_branch" ] if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch - assert isinstance( attributes[ "name" ], ( str, unicode ) ) + assert isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] self.__name = attributes[ "name" ] if "open_issues" in attributes and attributes[ "open_issues" ] is not None: # pragma no branch - assert isinstance( attributes[ "open_issues" ], int ) + assert isinstance( attributes[ "open_issues" ], int ), attributes[ "open_issues" ] self.__open_issues = attributes[ "open_issues" ] if "organization" in attributes and attributes[ "organization" ] is not None: # pragma no branch - assert isinstance( attributes[ "organization" ], dict ) + assert isinstance( attributes[ "organization" ], dict ), attributes[ "organization" ] self.__organization = Organization.Organization( self.__requester, attributes[ "organization" ], completion = LazyCompletion ) if "owner" in attributes and attributes[ "owner" ] is not None: # pragma no branch - assert isinstance( attributes[ "owner" ], dict ) + assert isinstance( attributes[ "owner" ], dict ), attributes[ "owner" ] self.__owner = NamedUser.NamedUser( self.__requester, attributes[ "owner" ], completion = LazyCompletion ) if "parent" in attributes and attributes[ "parent" ] is not None: # pragma no branch - assert isinstance( attributes[ "parent" ], dict ) + assert isinstance( attributes[ "parent" ], dict ), attributes[ "parent" ] self.__parent = Repository( self.__requester, attributes[ "parent" ], completion = LazyCompletion ) if "permissions" in attributes and attributes[ "permissions" ] is not None: # pragma no branch - assert isinstance( attributes[ "permissions" ], dict ) + assert isinstance( attributes[ "permissions" ], dict ), attributes[ "permissions" ] self.__permissions = Permissions.Permissions( self.__requester, attributes[ "permissions" ], completion = LazyCompletion ) if "private" in attributes and attributes[ "private" ] is not None: # pragma no branch - assert isinstance( attributes[ "private" ], bool ) + assert isinstance( attributes[ "private" ], bool ), attributes[ "private" ] self.__private = attributes[ "private" ] if "pushed_at" in attributes and attributes[ "pushed_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "pushed_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "pushed_at" ], ( str, unicode ) ), attributes[ "pushed_at" ] self.__pushed_at = attributes[ "pushed_at" ] if "size" in attributes and attributes[ "size" ] is not None: # pragma no branch - assert isinstance( attributes[ "size" ], int ) + assert isinstance( attributes[ "size" ], int ), attributes[ "size" ] self.__size = attributes[ "size" ] if "source" in attributes and attributes[ "source" ] is not None: # pragma no branch - assert isinstance( attributes[ "source" ], dict ) + assert isinstance( attributes[ "source" ], dict ), attributes[ "source" ] self.__source = Repository( self.__requester, attributes[ "source" ], completion = LazyCompletion ) if "ssh_url" in attributes and attributes[ "ssh_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "ssh_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "ssh_url" ], ( str, unicode ) ), attributes[ "ssh_url" ] self.__ssh_url = attributes[ "ssh_url" ] if "svn_url" in attributes and attributes[ "svn_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "svn_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "svn_url" ], ( str, unicode ) ), attributes[ "svn_url" ] self.__svn_url = attributes[ "svn_url" ] if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch - assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ) + assert isinstance( attributes[ "updated_at" ], ( str, unicode ) ), attributes[ "updated_at" ] self.__updated_at = attributes[ "updated_at" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch - assert isinstance( attributes[ "url" ], ( str, unicode ) ) + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] if "watchers" in attributes and attributes[ "watchers" ] is not None: # pragma no branch - assert isinstance( attributes[ "watchers" ], int ) + assert isinstance( attributes[ "watchers" ], int ), attributes[ "watchers" ] self.__watchers = attributes[ "watchers" ] diff --git a/src/github/RepositoryKey.py b/src/github/RepositoryKey.py index 70d16aab..0779f13a 100644 --- a/src/github/RepositoryKey.py +++ b/src/github/RepositoryKey.py @@ -89,13 +89,17 @@ class RepositoryKey( object ): def __useAttributes( self, attributes ): if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "key" in attributes and attributes[ "key" ] is not None: # pragma no branch + assert isinstance( attributes[ "key" ], ( str, unicode ) ), attributes[ "key" ] self.__key = attributes[ "key" ] if "title" in attributes and attributes[ "title" ] is not None: # pragma no branch + assert isinstance( attributes[ "title" ], ( str, unicode ) ), attributes[ "title" ] self.__title = attributes[ "title" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] if "verified" in attributes and attributes[ "verified" ] is not None: # pragma no branch - assert isinstance( attributes[ "verified" ], bool ) + assert isinstance( attributes[ "verified" ], bool ), attributes[ "verified" ] self.__verified = attributes[ "verified" ] diff --git a/src/github/Tag.py b/src/github/Tag.py index 6a982bcb..c968a5ef 100644 --- a/src/github/Tag.py +++ b/src/github/Tag.py @@ -35,14 +35,14 @@ class Tag( object ): def __useAttributes( self, attributes ): if "commit" in attributes and attributes[ "commit" ] is not None: # pragma no branch - assert isinstance( attributes[ "commit" ], dict ) + assert isinstance( attributes[ "commit" ], dict ), attributes[ "commit" ] self.__commit = Commit.Commit( self.__requester, attributes[ "commit" ], completion = LazyCompletion ) if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch - assert isinstance( attributes[ "name" ], ( str, unicode ) ) + assert isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] self.__name = attributes[ "name" ] if "tarball_url" in attributes and attributes[ "tarball_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "tarball_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "tarball_url" ], ( str, unicode ) ), attributes[ "tarball_url" ] self.__tarball_url = attributes[ "tarball_url" ] if "zipball_url" in attributes and attributes[ "zipball_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "zipball_url" ], ( str, unicode ) ) + assert isinstance( attributes[ "zipball_url" ], ( str, unicode ) ), attributes[ "zipball_url" ] self.__zipball_url = attributes[ "zipball_url" ] diff --git a/src/github/Team.py b/src/github/Team.py index 15875b91..716e80cc 100644 --- a/src/github/Team.py +++ b/src/github/Team.py @@ -169,14 +169,20 @@ class Team( object ): def __useAttributes( self, attributes ): if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "members_count" in attributes and attributes[ "members_count" ] is not None: # pragma no branch + assert isinstance( attributes[ "members_count" ], int ), attributes[ "members_count" ] self.__members_count = attributes[ "members_count" ] if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch + assert isinstance( attributes[ "name" ], ( str, unicode ) ), attributes[ "name" ] self.__name = attributes[ "name" ] if "permission" in attributes and attributes[ "permission" ] is not None: # pragma no branch + assert isinstance( attributes[ "permission" ], ( str, unicode ) ), attributes[ "permission" ] self.__permission = attributes[ "permission" ] if "repos_count" in attributes and attributes[ "repos_count" ] is not None: # pragma no branch + assert isinstance( attributes[ "repos_count" ], int ), attributes[ "repos_count" ] self.__repos_count = attributes[ "repos_count" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] diff --git a/src/github/UserKey.py b/src/github/UserKey.py index 7b8d8f96..acfed3f4 100644 --- a/src/github/UserKey.py +++ b/src/github/UserKey.py @@ -84,13 +84,17 @@ class UserKey( object ): def __useAttributes( self, attributes ): if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch + assert isinstance( attributes[ "id" ], int ), attributes[ "id" ] self.__id = attributes[ "id" ] if "key" in attributes and attributes[ "key" ] is not None: # pragma no branch + assert isinstance( attributes[ "key" ], ( str, unicode ) ), attributes[ "key" ] self.__key = attributes[ "key" ] if "title" in attributes and attributes[ "title" ] is not None: # pragma no branch + assert isinstance( attributes[ "title" ], ( str, unicode ) ), attributes[ "title" ] self.__title = attributes[ "title" ] if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch + assert isinstance( attributes[ "url" ], ( str, unicode ) ), attributes[ "url" ] self.__url = attributes[ "url" ] if "verified" in attributes and attributes[ "verified" ] is not None: # pragma no branch - assert isinstance( attributes[ "verified" ], bool ) + assert isinstance( attributes[ "verified" ], bool ), attributes[ "verified" ] self.__verified = attributes[ "verified" ] diff --git a/test/PullRequest.py b/test/PullRequest.py index c439d10d..67651c0a 100644 --- a/test/PullRequest.py +++ b/test/PullRequest.py @@ -23,7 +23,7 @@ class PullRequest( Framework.TestCase ): 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_by, {u'url': u'https://api.github.com/users/jacquev6', u'login': u'jacquev6', u'avatar_url': u'https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png', u'id': 327146, u'gravatar_id': u'b68de5ae38616c296fa345d2b9df2225'} ) ### @todo + 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 )