mirror of
https://github.com/status-im/PyGithub.git
synced 2026-09-01 11:21:16 +00:00
Improve message when we check that we know all attributes
This commit is contained in:
@@ -66,7 +66,7 @@ class {{ class.name }}( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ {% for attribute in class.attributes|dictsort:"name" %}"{{ attribute.name }}", {% endfor %}]
|
||||
assert attribute in [ {% for attribute in class.attributes|dictsort:"name" %}"{{ attribute.name }}", {% endfor %}], attribute
|
||||
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
{% for attribute in class.attributes|dictsort:"name" %}
|
||||
|
||||
@@ -568,7 +568,7 @@ class AuthenticatedUser( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "avatar_url", "bio", "blog", "collaborators", "company", "created_at", "disk_usage", "email", "followers", "following", "gravatar_id", "hireable", "html_url", "id", "location", "login", "name", "owned_private_repos", "plan", "private_gists", "public_gists", "public_repos", "total_private_repos", "type", "url", ]
|
||||
assert attribute in [ "avatar_url", "bio", "blog", "collaborators", "company", "created_at", "disk_usage", "email", "followers", "following", "gravatar_id", "hireable", "html_url", "id", "location", "login", "name", "owned_private_repos", "plan", "private_gists", "public_gists", "public_repos", "total_private_repos", "type", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None:
|
||||
assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) )
|
||||
|
||||
@@ -115,7 +115,7 @@ class Authorization( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "app", "created_at", "id", "note", "note_url", "scopes", "token", "updated_at", "url", ]
|
||||
assert attribute in [ "app", "created_at", "id", "note", "note_url", "scopes", "token", "updated_at", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "app" in attributes and attributes[ "app" ] is not None:
|
||||
self.__app = attributes[ "app" ]
|
||||
|
||||
@@ -27,7 +27,7 @@ class Branch( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "commit", "name", ]
|
||||
assert attribute in [ "commit", "name", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "commit" in attributes and attributes[ "commit" ] is not None:
|
||||
assert isinstance( attributes[ "commit" ], dict )
|
||||
|
||||
@@ -120,7 +120,7 @@ class Commit( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "author", "commit", "committer", "files", "parents", "sha", "stats", "url", ]
|
||||
assert attribute in [ "author", "commit", "committer", "files", "parents", "sha", "stats", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "author" in attributes and attributes[ "author" ] is not None:
|
||||
assert isinstance( attributes[ "author" ], dict )
|
||||
|
||||
@@ -119,7 +119,7 @@ class CommitComment( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "body", "commit_id", "created_at", "html_url", "id", "line", "path", "position", "updated_at", "url", "user", ]
|
||||
assert attribute in [ "body", "commit_id", "created_at", "html_url", "id", "line", "path", "position", "updated_at", "url", "user", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "body" in attributes and attributes[ "body" ] is not None:
|
||||
self.__body = attributes[ "body" ]
|
||||
|
||||
@@ -61,7 +61,7 @@ class CommitFile( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "additions", "blob_url", "changes", "deletions", "filename", "patch", "raw_url", "sha", "status", ]
|
||||
assert attribute in [ "additions", "blob_url", "changes", "deletions", "filename", "patch", "raw_url", "sha", "status", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "additions" in attributes and attributes[ "additions" ] is not None:
|
||||
self.__additions = attributes[ "additions" ]
|
||||
|
||||
@@ -31,7 +31,7 @@ class CommitStats( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "additions", "deletions", "total", ]
|
||||
assert attribute in [ "additions", "deletions", "total", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "additions" in attributes and attributes[ "additions" ] is not None:
|
||||
assert isinstance( attributes[ "additions" ], int )
|
||||
|
||||
@@ -160,7 +160,7 @@ class Download( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "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", ]
|
||||
assert attribute in [ "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", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "accesskeyid" in attributes and attributes[ "accesskeyid" ] is not None:
|
||||
self.__accesskeyid = attributes[ "accesskeyid" ]
|
||||
|
||||
+1
-1
@@ -107,7 +107,7 @@ class Event( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "actor", "commit_id", "created_at", "event", "id", "issue", "org", "payload", "public", "repo", "type", "url", ]
|
||||
assert attribute in [ "actor", "commit_id", "created_at", "event", "id", "issue", "org", "payload", "public", "repo", "type", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "actor" in attributes and attributes[ "actor" ] is not None:
|
||||
assert isinstance( attributes[ "actor" ], dict )
|
||||
|
||||
+1
-1
@@ -211,7 +211,7 @@ class Gist( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "comments", "created_at", "description", "files", "forks", "git_pull_url", "git_push_url", "history", "html_url", "id", "public", "updated_at", "url", "user", ]
|
||||
assert attribute in [ "comments", "created_at", "description", "files", "forks", "git_pull_url", "git_push_url", "history", "html_url", "id", "public", "updated_at", "url", "user", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "comments" in attributes and attributes[ "comments" ] is not None:
|
||||
self.__comments = attributes[ "comments" ]
|
||||
|
||||
@@ -89,7 +89,7 @@ class GistComment( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "body", "created_at", "id", "updated_at", "url", "user", ]
|
||||
assert attribute in [ "body", "created_at", "id", "updated_at", "url", "user", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "body" in attributes and attributes[ "body" ] is not None:
|
||||
self.__body = attributes[ "body" ]
|
||||
|
||||
@@ -31,7 +31,7 @@ class GitAuthor( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "date", "email", "name", ]
|
||||
assert attribute in [ "date", "email", "name", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "date" in attributes and attributes[ "date" ] is not None:
|
||||
assert isinstance( attributes[ "date" ], ( str, unicode ) )
|
||||
|
||||
@@ -41,7 +41,7 @@ class GitBlob( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "content", "encoding", "sha", "size", "url", ]
|
||||
assert attribute in [ "content", "encoding", "sha", "size", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "content" in attributes and attributes[ "content" ] is not None:
|
||||
assert isinstance( attributes[ "content" ], ( str, unicode ) )
|
||||
|
||||
@@ -54,7 +54,7 @@ class GitCommit( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "author", "committer", "message", "parents", "sha", "tree", "url", ]
|
||||
assert attribute in [ "author", "committer", "message", "parents", "sha", "tree", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "author" in attributes and attributes[ "author" ] is not None:
|
||||
assert isinstance( attributes[ "author" ], dict )
|
||||
|
||||
@@ -31,7 +31,7 @@ class GitObject( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "sha", "type", "url", ]
|
||||
assert attribute in [ "sha", "type", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
assert isinstance( attributes[ "sha" ], ( str, unicode ) )
|
||||
|
||||
@@ -54,7 +54,7 @@ class GitRef( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "object", "ref", "url", ]
|
||||
assert attribute in [ "object", "ref", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "object" in attributes and attributes[ "object" ] is not None:
|
||||
assert isinstance( attributes[ "object" ], dict )
|
||||
|
||||
@@ -48,7 +48,7 @@ class GitTag( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "message", "object", "sha", "tag", "tagger", "url", ]
|
||||
assert attribute in [ "message", "object", "sha", "tag", "tagger", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "message" in attributes and attributes[ "message" ] is not None:
|
||||
assert isinstance( attributes[ "message" ], ( str, unicode ) )
|
||||
|
||||
@@ -32,7 +32,7 @@ class GitTree( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "sha", "tree", "url", ]
|
||||
assert attribute in [ "sha", "tree", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
assert isinstance( attributes[ "sha" ], ( str, unicode ) )
|
||||
|
||||
@@ -46,7 +46,7 @@ class GitTreeElement( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "mode", "path", "sha", "size", "type", "url", ]
|
||||
assert attribute in [ "mode", "path", "sha", "size", "type", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "mode" in attributes and attributes[ "mode" ] is not None:
|
||||
assert isinstance( attributes[ "mode" ], ( str, unicode ) )
|
||||
|
||||
+1
-1
@@ -123,7 +123,7 @@ class Hook( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "active", "config", "created_at", "events", "id", "last_response", "name", "updated_at", "url", ]
|
||||
assert attribute in [ "active", "config", "created_at", "events", "id", "last_response", "name", "updated_at", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "active" in attributes and attributes[ "active" ] is not None:
|
||||
self.__active = attributes[ "active" ]
|
||||
|
||||
+1
-1
@@ -248,7 +248,7 @@ class Issue( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "assignee", "body", "closed_at", "closed_by", "comments", "created_at", "html_url", "id", "labels", "milestone", "number", "pull_request", "state", "title", "updated_at", "url", "user", ]
|
||||
assert attribute in [ "assignee", "body", "closed_at", "closed_by", "comments", "created_at", "html_url", "id", "labels", "milestone", "number", "pull_request", "state", "title", "updated_at", "url", "user", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "assignee" in attributes and attributes[ "assignee" ] is not None:
|
||||
assert isinstance( attributes[ "assignee" ], dict )
|
||||
|
||||
@@ -89,7 +89,7 @@ class IssueComment( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "body", "created_at", "id", "updated_at", "url", "user", ]
|
||||
assert attribute in [ "body", "created_at", "id", "updated_at", "url", "user", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "body" in attributes and attributes[ "body" ] is not None:
|
||||
self.__body = attributes[ "body" ]
|
||||
|
||||
@@ -75,7 +75,7 @@ class IssueEvent( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "actor", "commit_id", "created_at", "event", "id", "issue", "url", ]
|
||||
assert attribute in [ "actor", "commit_id", "created_at", "event", "id", "issue", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "actor" in attributes and attributes[ "actor" ] is not None:
|
||||
assert isinstance( attributes[ "actor" ], dict )
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ class Label( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "color", "name", "url", ]
|
||||
assert attribute in [ "color", "name", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "color" in attributes and attributes[ "color" ] is not None:
|
||||
self.__color = attributes[ "color" ]
|
||||
|
||||
@@ -140,7 +140,7 @@ class Milestone( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "closed_issues", "created_at", "creator", "description", "due_on", "id", "number", "open_issues", "state", "title", "url", ]
|
||||
assert attribute in [ "closed_issues", "created_at", "creator", "description", "due_on", "id", "number", "open_issues", "state", "title", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "closed_issues" in attributes and attributes[ "closed_issues" ] is not None:
|
||||
assert isinstance( attributes[ "closed_issues" ], int )
|
||||
|
||||
@@ -362,7 +362,7 @@ class NamedUser( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "avatar_url", "bio", "blog", "collaborators", "company", "contributions", "created_at", "disk_usage", "email", "followers", "following", "gravatar_id", "hireable", "html_url", "id", "location", "login", "name", "owned_private_repos", "plan", "private_gists", "public_gists", "public_repos", "total_private_repos", "type", "url", ]
|
||||
assert attribute in [ "avatar_url", "bio", "blog", "collaborators", "company", "contributions", "created_at", "disk_usage", "email", "followers", "following", "gravatar_id", "hireable", "html_url", "id", "location", "login", "name", "owned_private_repos", "plan", "private_gists", "public_gists", "public_repos", "total_private_repos", "type", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None:
|
||||
self.__avatar_url = attributes[ "avatar_url" ]
|
||||
|
||||
@@ -379,7 +379,7 @@ class Organization( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "avatar_url", "billing_email", "blog", "collaborators", "company", "created_at", "disk_usage", "email", "followers", "following", "gravatar_id", "html_url", "id", "location", "login", "name", "owned_private_repos", "plan", "private_gists", "public_gists", "public_repos", "total_private_repos", "type", "url", ]
|
||||
assert attribute in [ "avatar_url", "billing_email", "blog", "collaborators", "company", "created_at", "disk_usage", "email", "followers", "following", "gravatar_id", "html_url", "id", "location", "login", "name", "owned_private_repos", "plan", "private_gists", "public_gists", "public_repos", "total_private_repos", "type", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None:
|
||||
assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) )
|
||||
|
||||
@@ -31,7 +31,7 @@ class Permissions( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "admin", "pull", "push", ]
|
||||
assert attribute in [ "admin", "pull", "push", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "admin" in attributes and attributes[ "admin" ] is not None:
|
||||
assert isinstance( attributes[ "admin" ], bool )
|
||||
|
||||
+1
-1
@@ -36,7 +36,7 @@ class Plan( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "collaborators", "name", "private_repos", "space", ]
|
||||
assert attribute in [ "collaborators", "name", "private_repos", "space", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "collaborators" in attributes and attributes[ "collaborators" ] is not None:
|
||||
assert isinstance( attributes[ "collaborators" ], int )
|
||||
|
||||
@@ -277,7 +277,7 @@ class PullRequest( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "additions", "base", "body", "changed_files", "closed_at", "comments", "commits", "created_at", "deletions", "diff_url", "head", "html_url", "id", "issue_url", "mergeable", "merged", "merged_at", "merged_by", "number", "patch_url", "review_comments", "state", "title", "updated_at", "url", "user", ]
|
||||
assert attribute in [ "additions", "base", "body", "changed_files", "closed_at", "comments", "commits", "created_at", "deletions", "diff_url", "head", "html_url", "id", "issue_url", "mergeable", "merged", "merged_at", "merged_by", "number", "patch_url", "review_comments", "state", "title", "updated_at", "url", "user", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "additions" in attributes and attributes[ "additions" ] is not None:
|
||||
self.__additions = attributes[ "additions" ]
|
||||
|
||||
@@ -119,7 +119,7 @@ class PullRequestComment( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "body", "commit_id", "created_at", "html_url", "id", "line", "path", "position", "updated_at", "url", "user", ]
|
||||
assert attribute in [ "body", "commit_id", "created_at", "html_url", "id", "line", "path", "position", "updated_at", "url", "user", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "body" in attributes and attributes[ "body" ] is not None:
|
||||
self.__body = attributes[ "body" ]
|
||||
|
||||
@@ -61,7 +61,7 @@ class PullRequestFile( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "additions", "blob_url", "changes", "deletions", "filename", "patch", "raw_url", "sha", "status", ]
|
||||
assert attribute in [ "additions", "blob_url", "changes", "deletions", "filename", "patch", "raw_url", "sha", "status", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "additions" in attributes and attributes[ "additions" ] is not None:
|
||||
self.__additions = attributes[ "additions" ]
|
||||
|
||||
@@ -895,7 +895,7 @@ class Repository( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "clone_url", "created_at", "description", "fork", "forks", "git_url", "has_downloads", "has_issues", "has_wiki", "homepage", "html_url", "id", "language", "master_branch", "mirror_url", "name", "open_issues", "organization", "owner", "parent", "permissions", "private", "pushed_at", "size", "source", "ssh_url", "svn_url", "updated_at", "url", "watchers", ]
|
||||
assert attribute in [ "clone_url", "created_at", "description", "fork", "forks", "git_url", "has_downloads", "has_issues", "has_wiki", "homepage", "html_url", "id", "language", "master_branch", "mirror_url", "name", "open_issues", "organization", "owner", "parent", "permissions", "private", "pushed_at", "size", "source", "ssh_url", "svn_url", "updated_at", "url", "watchers", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "clone_url" in attributes and attributes[ "clone_url" ] is not None:
|
||||
assert isinstance( attributes[ "clone_url" ], ( str, unicode ) )
|
||||
|
||||
@@ -77,7 +77,7 @@ class RepositoryKey( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "id", "key", "title", "url", ]
|
||||
assert attribute in [ "id", "key", "title", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ class Tag( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "commit", "name", "tarball_url", "zipball_url", ]
|
||||
assert attribute in [ "commit", "name", "tarball_url", "zipball_url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "commit" in attributes and attributes[ "commit" ] is not None:
|
||||
assert isinstance( attributes[ "commit" ], dict )
|
||||
|
||||
+1
-1
@@ -170,7 +170,7 @@ class Team( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "id", "members_count", "name", "permission", "repos_count", "url", ]
|
||||
assert attribute in [ "id", "members_count", "name", "permission", "repos_count", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
|
||||
@@ -79,7 +79,7 @@ class UserKey( object ):
|
||||
def __useAttributes( self, attributes ):
|
||||
# @todo Remove this debug weakness: we shall assume that github will add new attributes
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "id", "key", "title", "url", ]
|
||||
assert attribute in [ "id", "key", "title", "url", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
self.__id = attributes[ "id" ]
|
||||
|
||||
Reference in New Issue
Block a user