mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 10:51:14 +00:00
Remove branch coverage for optional attributes (temporary?)
This commit is contained in:
@@ -70,7 +70,7 @@ class {{ class.name }}( object ):
|
||||
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
{% for attribute in class.attributes|dictsort:"name" %}
|
||||
if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None:
|
||||
if "{{ attribute.name }}" in attributes and attributes[ "{{ attribute.name }}" ] is not None: # pragma no branch
|
||||
|
||||
{% if attribute.type.cardinality == "scalar" %}
|
||||
{% if attribute.type.simple %}
|
||||
|
||||
@@ -568,78 +568,78 @@ class AuthenticatedUser( object ):
|
||||
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", ], 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:
|
||||
if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) )
|
||||
self.__avatar_url = attributes[ "avatar_url" ]
|
||||
if "bio" in attributes and attributes[ "bio" ] is not None:
|
||||
if "bio" in attributes and attributes[ "bio" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "bio" ], ( str, unicode ) )
|
||||
self.__bio = attributes[ "bio" ]
|
||||
if "blog" in attributes and attributes[ "blog" ] is not None:
|
||||
if "blog" in attributes and attributes[ "blog" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "blog" ], ( str, unicode ) )
|
||||
self.__blog = attributes[ "blog" ]
|
||||
if "collaborators" in attributes and attributes[ "collaborators" ] is not None:
|
||||
if "collaborators" in attributes and attributes[ "collaborators" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "collaborators" ], int )
|
||||
self.__collaborators = attributes[ "collaborators" ]
|
||||
if "company" in attributes and attributes[ "company" ] is not None:
|
||||
if "company" in attributes and attributes[ "company" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "company" ], ( str, unicode ) )
|
||||
self.__company = attributes[ "company" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "created_at" ], ( str, unicode ) )
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "disk_usage" in attributes and attributes[ "disk_usage" ] is not None:
|
||||
if "disk_usage" in attributes and attributes[ "disk_usage" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "disk_usage" ], int )
|
||||
self.__disk_usage = attributes[ "disk_usage" ]
|
||||
if "email" in attributes and attributes[ "email" ] is not None:
|
||||
if "email" in attributes and attributes[ "email" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "email" ], ( str, unicode ) )
|
||||
self.__email = attributes[ "email" ]
|
||||
if "followers" in attributes and attributes[ "followers" ] is not None:
|
||||
if "followers" in attributes and attributes[ "followers" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "followers" ], int )
|
||||
self.__followers = attributes[ "followers" ]
|
||||
if "following" in attributes and attributes[ "following" ] is not None:
|
||||
if "following" in attributes and attributes[ "following" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "following" ], int )
|
||||
self.__following = attributes[ "following" ]
|
||||
if "gravatar_id" in attributes and attributes[ "gravatar_id" ] is not None:
|
||||
if "gravatar_id" in attributes and attributes[ "gravatar_id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "gravatar_id" ], ( str, unicode ) )
|
||||
self.__gravatar_id = attributes[ "gravatar_id" ]
|
||||
if "hireable" in attributes and attributes[ "hireable" ] is not None:
|
||||
if "hireable" in attributes and attributes[ "hireable" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "hireable" ], bool )
|
||||
self.__hireable = attributes[ "hireable" ]
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "html_url" ], ( str, unicode ) )
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "id" ], int )
|
||||
self.__id = attributes[ "id" ]
|
||||
if "location" in attributes and attributes[ "location" ] is not None:
|
||||
if "location" in attributes and attributes[ "location" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "location" ], ( str, unicode ) )
|
||||
self.__location = attributes[ "location" ]
|
||||
if "login" in attributes and attributes[ "login" ] is not None:
|
||||
if "login" in attributes and attributes[ "login" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "login" ], ( str, unicode ) )
|
||||
self.__login = attributes[ "login" ]
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "name" ], ( str, unicode ) )
|
||||
self.__name = attributes[ "name" ]
|
||||
if "owned_private_repos" in attributes and attributes[ "owned_private_repos" ] is not None:
|
||||
if "owned_private_repos" in attributes and attributes[ "owned_private_repos" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "owned_private_repos" ], int )
|
||||
self.__owned_private_repos = attributes[ "owned_private_repos" ]
|
||||
if "plan" in attributes and attributes[ "plan" ] is not None:
|
||||
if "plan" in attributes and attributes[ "plan" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "plan" ], dict )
|
||||
self.__plan = Plan.Plan( self.__requester, attributes[ "plan" ], completion = LazyCompletion )
|
||||
if "private_gists" in attributes and attributes[ "private_gists" ] is not None:
|
||||
if "private_gists" in attributes and attributes[ "private_gists" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "private_gists" ], int )
|
||||
self.__private_gists = attributes[ "private_gists" ]
|
||||
if "public_gists" in attributes and attributes[ "public_gists" ] is not None:
|
||||
if "public_gists" in attributes and attributes[ "public_gists" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "public_gists" ], int )
|
||||
self.__public_gists = attributes[ "public_gists" ]
|
||||
if "public_repos" in attributes and attributes[ "public_repos" ] is not None:
|
||||
if "public_repos" in attributes and attributes[ "public_repos" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "public_repos" ], int )
|
||||
self.__public_repos = attributes[ "public_repos" ]
|
||||
if "total_private_repos" in attributes and attributes[ "total_private_repos" ] is not None:
|
||||
if "total_private_repos" in attributes and attributes[ "total_private_repos" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "total_private_repos" ], int )
|
||||
self.__total_private_repos = attributes[ "total_private_repos" ]
|
||||
if "type" in attributes and attributes[ "type" ] is not None:
|
||||
if "type" in attributes and attributes[ "type" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "type" ], ( str, unicode ) )
|
||||
self.__type = attributes[ "type" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -117,21 +117,21 @@ class Authorization( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
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:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
self.__id = attributes[ "id" ]
|
||||
if "note" in attributes and attributes[ "note" ] is not None:
|
||||
if "note" in attributes and attributes[ "note" ] is not None: # pragma no branch
|
||||
self.__note = attributes[ "note" ]
|
||||
if "note_url" in attributes and attributes[ "note_url" ] is not None:
|
||||
if "note_url" in attributes and attributes[ "note_url" ] is not None: # pragma no branch
|
||||
self.__note_url = attributes[ "note_url" ]
|
||||
if "scopes" in attributes and attributes[ "scopes" ] is not None:
|
||||
if "scopes" in attributes and attributes[ "scopes" ] is not None: # pragma no branch
|
||||
self.__scopes = attributes[ "scopes" ]
|
||||
if "token" in attributes and attributes[ "token" ] is not None:
|
||||
if "token" in attributes and attributes[ "token" ] is not None: # pragma no branch
|
||||
self.__token = attributes[ "token" ]
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -28,9 +28,9 @@ class Branch( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "commit" in attributes and attributes[ "commit" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "commit" ], dict )
|
||||
self.__commit = Commit.Commit( self.__requester, attributes[ "commit" ], completion = LazyCompletion )
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "name" ], ( str, unicode ) )
|
||||
self.__name = attributes[ "name" ]
|
||||
|
||||
@@ -120,33 +120,33 @@ class Commit( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "author" in attributes and attributes[ "author" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "author" ], dict )
|
||||
self.__author = NamedUser.NamedUser( self.__requester, attributes[ "author" ], completion = LazyCompletion )
|
||||
if "commit" in attributes and attributes[ "commit" ] is not None:
|
||||
if "commit" in attributes and attributes[ "commit" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "commit" ], dict )
|
||||
self.__commit = GitCommit.GitCommit( self.__requester, attributes[ "commit" ], completion = LazyCompletion )
|
||||
if "committer" in attributes and attributes[ "committer" ] is not None:
|
||||
if "committer" in attributes and attributes[ "committer" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "committer" ], dict )
|
||||
self.__committer = NamedUser.NamedUser( self.__requester, attributes[ "committer" ], completion = LazyCompletion )
|
||||
if "files" in attributes and attributes[ "files" ] is not None:
|
||||
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 ) )
|
||||
self.__files = [
|
||||
CommitFile.CommitFile( self.__requester, element, completion = LazyCompletion )
|
||||
for element in attributes[ "files" ]
|
||||
]
|
||||
if "parents" in attributes and attributes[ "parents" ] is not None:
|
||||
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 ) )
|
||||
self.__parents = [
|
||||
Commit( self.__requester, element, completion = LazyCompletion )
|
||||
for element in attributes[ "parents" ]
|
||||
]
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "sha" ], ( str, unicode ) )
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "stats" in attributes and attributes[ "stats" ] is not None:
|
||||
if "stats" in attributes and attributes[ "stats" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "stats" ], dict )
|
||||
self.__stats = CommitStats.CommitStats( self.__requester, attributes[ "stats" ], completion = LazyCompletion )
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
+11
-11
@@ -121,36 +121,36 @@ class CommitComment( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "body" ], ( str, unicode ) )
|
||||
self.__body = attributes[ "body" ]
|
||||
if "commit_id" in attributes and attributes[ "commit_id" ] is not None:
|
||||
if "commit_id" in attributes and attributes[ "commit_id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "commit_id" ], ( str, unicode ) )
|
||||
self.__commit_id = attributes[ "commit_id" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "created_at" ], ( str, unicode ) )
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "html_url" ], ( str, unicode ) )
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "id" ], int )
|
||||
self.__id = attributes[ "id" ]
|
||||
if "line" in attributes and attributes[ "line" ] is not None:
|
||||
if "line" in attributes and attributes[ "line" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "line" ], int )
|
||||
self.__line = attributes[ "line" ]
|
||||
if "path" in attributes and attributes[ "path" ] is not None:
|
||||
if "path" in attributes and attributes[ "path" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "path" ], ( str, unicode ) )
|
||||
self.__path = attributes[ "path" ]
|
||||
if "position" in attributes and attributes[ "position" ] is not None:
|
||||
if "position" in attributes and attributes[ "position" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "position" ], int )
|
||||
self.__position = attributes[ "position" ]
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "updated_at" ], ( str, unicode ) )
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "user" ], dict )
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion )
|
||||
|
||||
@@ -62,21 +62,21 @@ class CommitFile( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "additions" in attributes and attributes[ "additions" ] is not None: # pragma no branch
|
||||
self.__additions = attributes[ "additions" ]
|
||||
if "blob_url" in attributes and attributes[ "blob_url" ] is not None:
|
||||
if "blob_url" in attributes and attributes[ "blob_url" ] is not None: # pragma no branch
|
||||
self.__blob_url = attributes[ "blob_url" ]
|
||||
if "changes" in attributes and attributes[ "changes" ] is not None:
|
||||
if "changes" in attributes and attributes[ "changes" ] is not None: # pragma no branch
|
||||
self.__changes = attributes[ "changes" ]
|
||||
if "deletions" in attributes and attributes[ "deletions" ] is not None:
|
||||
if "deletions" in attributes and attributes[ "deletions" ] is not None: # pragma no branch
|
||||
self.__deletions = attributes[ "deletions" ]
|
||||
if "filename" in attributes and attributes[ "filename" ] is not None:
|
||||
if "filename" in attributes and attributes[ "filename" ] is not None: # pragma no branch
|
||||
self.__filename = attributes[ "filename" ]
|
||||
if "patch" in attributes and attributes[ "patch" ] is not None:
|
||||
if "patch" in attributes and attributes[ "patch" ] is not None: # pragma no branch
|
||||
self.__patch = attributes[ "patch" ]
|
||||
if "raw_url" in attributes and attributes[ "raw_url" ] is not None:
|
||||
if "raw_url" in attributes and attributes[ "raw_url" ] is not None: # pragma no branch
|
||||
self.__raw_url = attributes[ "raw_url" ]
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "status" in attributes and attributes[ "status" ] is not None:
|
||||
if "status" in attributes and attributes[ "status" ] is not None: # pragma no branch
|
||||
self.__status = attributes[ "status" ]
|
||||
|
||||
@@ -32,12 +32,12 @@ class CommitStats( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "additions" in attributes and attributes[ "additions" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "additions" ], int )
|
||||
self.__additions = attributes[ "additions" ]
|
||||
if "deletions" in attributes and attributes[ "deletions" ] is not None:
|
||||
if "deletions" in attributes and attributes[ "deletions" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "deletions" ], int )
|
||||
self.__deletions = attributes[ "deletions" ]
|
||||
if "total" in attributes and attributes[ "total" ] is not None:
|
||||
if "total" in attributes and attributes[ "total" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "total" ], int )
|
||||
self.__total = attributes[ "total" ]
|
||||
|
||||
+20
-20
@@ -162,43 +162,43 @@ class Download( object ):
|
||||
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", "x-amz-meta-content-disposition" ], 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:
|
||||
if "accesskeyid" in attributes and attributes[ "accesskeyid" ] is not None: # pragma no branch
|
||||
self.__accesskeyid = attributes[ "accesskeyid" ]
|
||||
if "acl" in attributes and attributes[ "acl" ] is not None:
|
||||
if "acl" in attributes and attributes[ "acl" ] is not None: # pragma no branch
|
||||
self.__acl = attributes[ "acl" ]
|
||||
if "bucket" in attributes and attributes[ "bucket" ] is not None:
|
||||
if "bucket" in attributes and attributes[ "bucket" ] is not None: # pragma no branch
|
||||
self.__bucket = attributes[ "bucket" ]
|
||||
if "content_type" in attributes and attributes[ "content_type" ] is not None:
|
||||
if "content_type" in attributes and attributes[ "content_type" ] is not None: # pragma no branch
|
||||
self.__content_type = attributes[ "content_type" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "description" in attributes and attributes[ "description" ] is not None:
|
||||
if "description" in attributes and attributes[ "description" ] is not None: # pragma no branch
|
||||
self.__description = attributes[ "description" ]
|
||||
if "download_count" in attributes and attributes[ "download_count" ] is not None:
|
||||
if "download_count" in attributes and attributes[ "download_count" ] is not None: # pragma no branch
|
||||
self.__download_count = attributes[ "download_count" ]
|
||||
if "expirationdate" in attributes and attributes[ "expirationdate" ] is not None:
|
||||
if "expirationdate" in attributes and attributes[ "expirationdate" ] is not None: # pragma no branch
|
||||
self.__expirationdate = attributes[ "expirationdate" ]
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
self.__id = attributes[ "id" ]
|
||||
if "mime_type" in attributes and attributes[ "mime_type" ] is not None:
|
||||
if "mime_type" in attributes and attributes[ "mime_type" ] is not None: # pragma no branch
|
||||
self.__mime_type = attributes[ "mime_type" ]
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
|
||||
self.__name = attributes[ "name" ]
|
||||
if "path" in attributes and attributes[ "path" ] is not None:
|
||||
if "path" in attributes and attributes[ "path" ] is not None: # pragma no branch
|
||||
self.__path = attributes[ "path" ]
|
||||
if "policy" in attributes and attributes[ "policy" ] is not None:
|
||||
if "policy" in attributes and attributes[ "policy" ] is not None: # pragma no branch
|
||||
self.__policy = attributes[ "policy" ]
|
||||
if "prefix" in attributes and attributes[ "prefix" ] is not None:
|
||||
if "prefix" in attributes and attributes[ "prefix" ] is not None: # pragma no branch
|
||||
self.__prefix = attributes[ "prefix" ]
|
||||
if "redirect" in attributes and attributes[ "redirect" ] is not None:
|
||||
if "redirect" in attributes and attributes[ "redirect" ] is not None: # pragma no branch
|
||||
self.__redirect = attributes[ "redirect" ]
|
||||
if "s3_url" in attributes and attributes[ "s3_url" ] is not None:
|
||||
if "s3_url" in attributes and attributes[ "s3_url" ] is not None: # pragma no branch
|
||||
self.__s3_url = attributes[ "s3_url" ]
|
||||
if "signature" in attributes and attributes[ "signature" ] is not None:
|
||||
if "signature" in attributes and attributes[ "signature" ] is not None: # pragma no branch
|
||||
self.__signature = attributes[ "signature" ]
|
||||
if "size" in attributes and attributes[ "size" ] is not None:
|
||||
if "size" in attributes and attributes[ "size" ] is not None: # pragma no branch
|
||||
self.__size = attributes[ "size" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
+8
-8
@@ -60,22 +60,22 @@ class Event( object ):
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "actor", "created_at", "id", "org", "payload", "public", "repo", "type", ], 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:
|
||||
if "actor" in attributes and attributes[ "actor" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "actor" ], dict )
|
||||
self.__actor = NamedUser.NamedUser( self.__requester, attributes[ "actor" ], completion = LazyCompletion )
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
self.__id = attributes[ "id" ]
|
||||
if "org" in attributes and attributes[ "org" ] is not None:
|
||||
if "org" in attributes and attributes[ "org" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "org" ], dict )
|
||||
self.__org = Organization.Organization( self.__requester, attributes[ "org" ], completion = LazyCompletion )
|
||||
if "payload" in attributes and attributes[ "payload" ] is not None:
|
||||
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:
|
||||
if "public" in attributes and attributes[ "public" ] is not None: # pragma no branch
|
||||
self.__public = attributes[ "public" ]
|
||||
if "repo" in attributes and attributes[ "repo" ] is not None:
|
||||
if "repo" in attributes and attributes[ "repo" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "repo" ], dict )
|
||||
self.__repo = Repository.Repository( self.__requester, attributes[ "repo" ], completion = LazyCompletion )
|
||||
if "type" in attributes and attributes[ "type" ] is not None:
|
||||
if "type" in attributes and attributes[ "type" ] is not None: # pragma no branch
|
||||
self.__type = attributes[ "type" ]
|
||||
|
||||
+15
-15
@@ -220,53 +220,53 @@ class Gist( object ):
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "comments", "created_at", "description", "files", "fork_of", "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:
|
||||
if "comments" in attributes and attributes[ "comments" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "comments" ], int )
|
||||
self.__comments = attributes[ "comments" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "created_at" ], ( str, unicode ) )
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "description" in attributes and attributes[ "description" ] is not None:
|
||||
if "description" in attributes and attributes[ "description" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "description" ], ( str, unicode ) )
|
||||
self.__description = attributes[ "description" ]
|
||||
if "files" in attributes and attributes[ "files" ] is not None:
|
||||
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:
|
||||
if "fork_of" in attributes and attributes[ "fork_of" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "fork_of" ], dict )
|
||||
self.__fork_of = Gist( self.__requester, attributes[ "fork_of" ], completion = LazyCompletion )
|
||||
if "forks" in attributes and attributes[ "forks" ] is not None:
|
||||
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 ) )
|
||||
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:
|
||||
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 ) )
|
||||
self.__git_pull_url = attributes[ "git_pull_url" ]
|
||||
if "git_push_url" in attributes and attributes[ "git_push_url" ] is not None:
|
||||
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 ) )
|
||||
self.__git_push_url = attributes[ "git_push_url" ]
|
||||
if "history" in attributes and attributes[ "history" ] is not None:
|
||||
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 ) )
|
||||
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:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "html_url" ], ( str, unicode ) )
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "id" ], ( str, unicode ) )
|
||||
self.__id = attributes[ "id" ]
|
||||
if "public" in attributes and attributes[ "public" ] is not None:
|
||||
if "public" in attributes and attributes[ "public" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "public" ], bool )
|
||||
self.__public = attributes[ "public" ]
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "updated_at" ], ( str, unicode ) )
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "user" ], dict )
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion )
|
||||
|
||||
@@ -68,16 +68,16 @@ class GistComment( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch
|
||||
self.__body = attributes[ "body" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
self.__id = attributes[ "id" ]
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "user" ], dict )
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion )
|
||||
|
||||
@@ -44,18 +44,18 @@ class GistHistoryState( object ):
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "change_status", "committed_at", "url", "user", "version", ], attribute
|
||||
# @todo No need to check if attribute is in attributes when attribute is mandatory
|
||||
if "change_status" in attributes and attributes[ "change_status" ] is not None:
|
||||
if "change_status" in attributes and attributes[ "change_status" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "change_status" ], dict )
|
||||
self.__change_status = CommitStats.CommitStats( self.__requester, attributes[ "change_status" ], completion = LazyCompletion )
|
||||
if "committed_at" in attributes and attributes[ "committed_at" ] is not None:
|
||||
if "committed_at" in attributes and attributes[ "committed_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "committed_at" ], ( str, unicode ) )
|
||||
self.__committed_at = attributes[ "committed_at" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "user" ], dict )
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion )
|
||||
if "version" in attributes and attributes[ "version" ] is not None:
|
||||
if "version" in attributes and attributes[ "version" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "version" ], ( str, unicode ) )
|
||||
self.__version = attributes[ "version" ]
|
||||
|
||||
@@ -32,12 +32,12 @@ class GitAuthor( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "date" in attributes and attributes[ "date" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "date" ], ( str, unicode ) )
|
||||
self.__date = attributes[ "date" ]
|
||||
if "email" in attributes and attributes[ "email" ] is not None:
|
||||
if "email" in attributes and attributes[ "email" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "email" ], ( str, unicode ) )
|
||||
self.__email = attributes[ "email" ]
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "name" ], ( str, unicode ) )
|
||||
self.__name = attributes[ "name" ]
|
||||
|
||||
@@ -42,18 +42,18 @@ class GitBlob( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "content" in attributes and attributes[ "content" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "content" ], ( str, unicode ) )
|
||||
self.__content = attributes[ "content" ]
|
||||
if "encoding" in attributes and attributes[ "encoding" ] is not None:
|
||||
if "encoding" in attributes and attributes[ "encoding" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "encoding" ], ( str, unicode ) )
|
||||
self.__encoding = attributes[ "encoding" ]
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "sha" ], ( str, unicode ) )
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "size" in attributes and attributes[ "size" ] is not None:
|
||||
if "size" in attributes and attributes[ "size" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "size" ], int )
|
||||
self.__size = attributes[ "size" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -55,27 +55,27 @@ class GitCommit( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "author" in attributes and attributes[ "author" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "author" ], dict )
|
||||
self.__author = GitAuthor.GitAuthor( self.__requester, attributes[ "author" ], completion = LazyCompletion )
|
||||
if "committer" in attributes and attributes[ "committer" ] is not None:
|
||||
if "committer" in attributes and attributes[ "committer" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "committer" ], dict )
|
||||
self.__committer = GitAuthor.GitAuthor( self.__requester, attributes[ "committer" ], completion = LazyCompletion )
|
||||
if "message" in attributes and attributes[ "message" ] is not None:
|
||||
if "message" in attributes and attributes[ "message" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "message" ], ( str, unicode ) )
|
||||
self.__message = attributes[ "message" ]
|
||||
if "parents" in attributes and attributes[ "parents" ] is not None:
|
||||
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 ) )
|
||||
self.__parents = [
|
||||
GitCommit( self.__requester, element, completion = LazyCompletion )
|
||||
for element in attributes[ "parents" ]
|
||||
]
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "sha" ], ( str, unicode ) )
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "tree" in attributes and attributes[ "tree" ] is not None:
|
||||
if "tree" in attributes and attributes[ "tree" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "tree" ], dict )
|
||||
self.__tree = GitTree.GitTree( self.__requester, attributes[ "tree" ], completion = LazyCompletion )
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -32,12 +32,12 @@ class GitObject( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "sha" ], ( str, unicode ) )
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "type" in attributes and attributes[ "type" ] is not None:
|
||||
if "type" in attributes and attributes[ "type" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "type" ], ( str, unicode ) )
|
||||
self.__type = attributes[ "type" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -55,12 +55,12 @@ class GitRef( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "object" in attributes and attributes[ "object" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "object" ], dict )
|
||||
self.__object = GitObject.GitObject( self.__requester, attributes[ "object" ], completion = LazyCompletion )
|
||||
if "ref" in attributes and attributes[ "ref" ] is not None:
|
||||
if "ref" in attributes and attributes[ "ref" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "ref" ], ( str, unicode ) )
|
||||
self.__ref = attributes[ "ref" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -49,21 +49,21 @@ class GitTag( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "message" in attributes and attributes[ "message" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "message" ], ( str, unicode ) )
|
||||
self.__message = attributes[ "message" ]
|
||||
if "object" in attributes and attributes[ "object" ] is not None:
|
||||
if "object" in attributes and attributes[ "object" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "object" ], dict )
|
||||
self.__object = GitObject.GitObject( self.__requester, attributes[ "object" ], completion = LazyCompletion )
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "sha" ], ( str, unicode ) )
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "tag" in attributes and attributes[ "tag" ] is not None:
|
||||
if "tag" in attributes and attributes[ "tag" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "tag" ], ( str, unicode ) )
|
||||
self.__tag = attributes[ "tag" ]
|
||||
if "tagger" in attributes and attributes[ "tagger" ] is not None:
|
||||
if "tagger" in attributes and attributes[ "tagger" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "tagger" ], dict )
|
||||
self.__tagger = GitAuthor.GitAuthor( self.__requester, attributes[ "tagger" ], completion = LazyCompletion )
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -33,15 +33,15 @@ class GitTree( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "sha" ], ( str, unicode ) )
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "tree" in attributes and attributes[ "tree" ] is not None:
|
||||
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 ) )
|
||||
self.__tree = [
|
||||
GitTreeElement.GitTreeElement( self.__requester, element, completion = LazyCompletion )
|
||||
for element in attributes[ "tree" ]
|
||||
]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -47,21 +47,21 @@ class GitTreeElement( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "mode" in attributes and attributes[ "mode" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "mode" ], ( str, unicode ) )
|
||||
self.__mode = attributes[ "mode" ]
|
||||
if "path" in attributes and attributes[ "path" ] is not None:
|
||||
if "path" in attributes and attributes[ "path" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "path" ], ( str, unicode ) )
|
||||
self.__path = attributes[ "path" ]
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "sha" ], ( str, unicode ) )
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "size" in attributes and attributes[ "size" ] is not None:
|
||||
if "size" in attributes and attributes[ "size" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "size" ], int )
|
||||
self.__size = attributes[ "size" ]
|
||||
if "type" in attributes and attributes[ "type" ] is not None:
|
||||
if "type" in attributes and attributes[ "type" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "type" ], ( str, unicode ) )
|
||||
self.__type = attributes[ "type" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
+9
-9
@@ -99,21 +99,21 @@ class Hook( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "active" in attributes and attributes[ "active" ] is not None: # pragma no branch
|
||||
self.__active = attributes[ "active" ]
|
||||
if "config" in attributes and attributes[ "config" ] is not None:
|
||||
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:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "events" in attributes and attributes[ "events" ] is not None:
|
||||
if "events" in attributes and attributes[ "events" ] is not None: # pragma no branch
|
||||
self.__events = attributes[ "events" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
self.__id = attributes[ "id" ]
|
||||
if "last_response" in attributes and attributes[ "last_response" ] is not None:
|
||||
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:
|
||||
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
|
||||
self.__name = attributes[ "name" ]
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
+18
-18
@@ -257,59 +257,59 @@ class Issue( object ):
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "assignee", "body", "closed_at", "closed_by", "comments", "created_at", "html_url", "id", "labels", "milestone", "number", "pull_request", "repository", "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:
|
||||
if "assignee" in attributes and attributes[ "assignee" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "assignee" ], dict )
|
||||
self.__assignee = NamedUser.NamedUser( self.__requester, attributes[ "assignee" ], completion = LazyCompletion )
|
||||
if "body" in attributes and attributes[ "body" ] is not None:
|
||||
if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "body" ], ( str, unicode ) )
|
||||
self.__body = attributes[ "body" ]
|
||||
if "closed_at" in attributes and attributes[ "closed_at" ] is not None:
|
||||
if "closed_at" in attributes and attributes[ "closed_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "closed_at" ], ( str, unicode ) )
|
||||
self.__closed_at = attributes[ "closed_at" ]
|
||||
if "closed_by" in attributes and attributes[ "closed_by" ] is not None:
|
||||
if "closed_by" in attributes and attributes[ "closed_by" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "closed_by" ], dict )
|
||||
self.__closed_by = NamedUser.NamedUser( self.__requester, attributes[ "closed_by" ], completion = LazyCompletion )
|
||||
if "comments" in attributes and attributes[ "comments" ] is not None:
|
||||
if "comments" in attributes and attributes[ "comments" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "comments" ], int )
|
||||
self.__comments = attributes[ "comments" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "created_at" ], ( str, unicode ) )
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "html_url" ], ( str, unicode ) )
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "id" ], int )
|
||||
self.__id = attributes[ "id" ]
|
||||
if "labels" in attributes and attributes[ "labels" ] is not None:
|
||||
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 ) )
|
||||
self.__labels = [
|
||||
Label.Label( self.__requester, element, completion = LazyCompletion )
|
||||
for element in attributes[ "labels" ]
|
||||
]
|
||||
if "milestone" in attributes and attributes[ "milestone" ] is not None:
|
||||
if "milestone" in attributes and attributes[ "milestone" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "milestone" ], dict )
|
||||
self.__milestone = Milestone.Milestone( self.__requester, attributes[ "milestone" ], completion = LazyCompletion )
|
||||
if "number" in attributes and attributes[ "number" ] is not None:
|
||||
if "number" in attributes and attributes[ "number" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "number" ], int )
|
||||
self.__number = attributes[ "number" ]
|
||||
if "pull_request" in attributes and attributes[ "pull_request" ] is not None:
|
||||
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:
|
||||
if "repository" in attributes and attributes[ "repository" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "repository" ], dict )
|
||||
self.__repository = Repository.Repository( self.__requester, attributes[ "repository" ], completion = LazyCompletion )
|
||||
if "state" in attributes and attributes[ "state" ] is not None:
|
||||
if "state" in attributes and attributes[ "state" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "state" ], ( str, unicode ) )
|
||||
self.__state = attributes[ "state" ]
|
||||
if "title" in attributes and attributes[ "title" ] is not None:
|
||||
if "title" in attributes and attributes[ "title" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "title" ], ( str, unicode ) )
|
||||
self.__title = attributes[ "title" ]
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "updated_at" ], ( str, unicode ) )
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "user" ], dict )
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion )
|
||||
|
||||
@@ -68,16 +68,16 @@ class IssueComment( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch
|
||||
self.__body = attributes[ "body" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
self.__id = attributes[ "id" ]
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "user" ], dict )
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion )
|
||||
|
||||
@@ -78,24 +78,24 @@ class IssueEvent( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "actor" in attributes and attributes[ "actor" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "actor" ], dict )
|
||||
self.__actor = NamedUser.NamedUser( self.__requester, attributes[ "actor" ], completion = LazyCompletion )
|
||||
if "commit_id" in attributes and attributes[ "commit_id" ] is not None:
|
||||
if "commit_id" in attributes and attributes[ "commit_id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "commit_id" ], ( str, unicode ) )
|
||||
self.__commit_id = attributes[ "commit_id" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "created_at" ], ( str, unicode ) )
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "event" in attributes and attributes[ "event" ] is not None:
|
||||
if "event" in attributes and attributes[ "event" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "event" ], ( str, unicode ) )
|
||||
self.__event = attributes[ "event" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "id" ], int )
|
||||
self.__id = attributes[ "id" ]
|
||||
if "issue" in attributes and attributes[ "issue" ] is not None:
|
||||
if "issue" in attributes and attributes[ "issue" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "issue" ], dict )
|
||||
self.__issue = Issue.Issue( self.__requester, attributes[ "issue" ], completion = LazyCompletion )
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
+3
-3
@@ -53,9 +53,9 @@ class Label( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "color" in attributes and attributes[ "color" ] is not None: # pragma no branch
|
||||
self.__color = attributes[ "color" ]
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
|
||||
self.__name = attributes[ "name" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
+11
-11
@@ -114,36 +114,36 @@ class Milestone( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "closed_issues" in attributes and attributes[ "closed_issues" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "closed_issues" ], int )
|
||||
self.__closed_issues = attributes[ "closed_issues" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "created_at" ], ( str, unicode ) )
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "creator" in attributes and attributes[ "creator" ] is not None:
|
||||
if "creator" in attributes and attributes[ "creator" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "creator" ], dict )
|
||||
self.__creator = NamedUser.NamedUser( self.__requester, attributes[ "creator" ], completion = LazyCompletion )
|
||||
if "description" in attributes and attributes[ "description" ] is not None:
|
||||
if "description" in attributes and attributes[ "description" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "description" ], ( str, unicode ) )
|
||||
self.__description = attributes[ "description" ]
|
||||
if "due_on" in attributes and attributes[ "due_on" ] is not None:
|
||||
if "due_on" in attributes and attributes[ "due_on" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "due_on" ], ( str, unicode ) )
|
||||
self.__due_on = attributes[ "due_on" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "id" ], int )
|
||||
self.__id = attributes[ "id" ]
|
||||
if "number" in attributes and attributes[ "number" ] is not None:
|
||||
if "number" in attributes and attributes[ "number" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "number" ], int )
|
||||
self.__number = attributes[ "number" ]
|
||||
if "open_issues" in attributes and attributes[ "open_issues" ] is not None:
|
||||
if "open_issues" in attributes and attributes[ "open_issues" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "open_issues" ], int )
|
||||
self.__open_issues = attributes[ "open_issues" ]
|
||||
if "state" in attributes and attributes[ "state" ] is not None:
|
||||
if "state" in attributes and attributes[ "state" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "state" ], ( str, unicode ) )
|
||||
self.__state = attributes[ "state" ]
|
||||
if "title" in attributes and attributes[ "title" ] is not None:
|
||||
if "title" in attributes and attributes[ "title" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "title" ], ( str, unicode ) )
|
||||
self.__title = attributes[ "title" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
+26
-26
@@ -365,81 +365,81 @@ class NamedUser( object ):
|
||||
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", ], 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:
|
||||
if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) )
|
||||
self.__avatar_url = attributes[ "avatar_url" ]
|
||||
if "bio" in attributes and attributes[ "bio" ] is not None:
|
||||
if "bio" in attributes and attributes[ "bio" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "bio" ], ( str, unicode ) )
|
||||
self.__bio = attributes[ "bio" ]
|
||||
if "blog" in attributes and attributes[ "blog" ] is not None:
|
||||
if "blog" in attributes and attributes[ "blog" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "blog" ], ( str, unicode ) )
|
||||
self.__blog = attributes[ "blog" ]
|
||||
if "collaborators" in attributes and attributes[ "collaborators" ] is not None:
|
||||
if "collaborators" in attributes and attributes[ "collaborators" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "collaborators" ], int )
|
||||
self.__collaborators = attributes[ "collaborators" ]
|
||||
if "company" in attributes and attributes[ "company" ] is not None:
|
||||
if "company" in attributes and attributes[ "company" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "company" ], ( str, unicode ) )
|
||||
self.__company = attributes[ "company" ]
|
||||
if "contributions" in attributes and attributes[ "contributions" ] is not None:
|
||||
if "contributions" in attributes and attributes[ "contributions" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "contributions" ], int )
|
||||
self.__contributions = attributes[ "contributions" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "created_at" ], ( str, unicode ) )
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "disk_usage" in attributes and attributes[ "disk_usage" ] is not None:
|
||||
if "disk_usage" in attributes and attributes[ "disk_usage" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "disk_usage" ], int )
|
||||
self.__disk_usage = attributes[ "disk_usage" ]
|
||||
if "email" in attributes and attributes[ "email" ] is not None:
|
||||
if "email" in attributes and attributes[ "email" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "email" ], ( str, unicode ) )
|
||||
self.__email = attributes[ "email" ]
|
||||
if "followers" in attributes and attributes[ "followers" ] is not None:
|
||||
if "followers" in attributes and attributes[ "followers" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "followers" ], int )
|
||||
self.__followers = attributes[ "followers" ]
|
||||
if "following" in attributes and attributes[ "following" ] is not None:
|
||||
if "following" in attributes and attributes[ "following" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "following" ], int )
|
||||
self.__following = attributes[ "following" ]
|
||||
if "gravatar_id" in attributes and attributes[ "gravatar_id" ] is not None:
|
||||
if "gravatar_id" in attributes and attributes[ "gravatar_id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "gravatar_id" ], ( str, unicode ) )
|
||||
self.__gravatar_id = attributes[ "gravatar_id" ]
|
||||
if "hireable" in attributes and attributes[ "hireable" ] is not None:
|
||||
if "hireable" in attributes and attributes[ "hireable" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "hireable" ], bool )
|
||||
self.__hireable = attributes[ "hireable" ]
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "html_url" ], ( str, unicode ) )
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "id" ], int )
|
||||
self.__id = attributes[ "id" ]
|
||||
if "location" in attributes and attributes[ "location" ] is not None:
|
||||
if "location" in attributes and attributes[ "location" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "location" ], ( str, unicode ) )
|
||||
self.__location = attributes[ "location" ]
|
||||
if "login" in attributes and attributes[ "login" ] is not None:
|
||||
if "login" in attributes and attributes[ "login" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "login" ], ( str, unicode ) )
|
||||
self.__login = attributes[ "login" ]
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "name" ], ( str, unicode ) )
|
||||
self.__name = attributes[ "name" ]
|
||||
if "owned_private_repos" in attributes and attributes[ "owned_private_repos" ] is not None:
|
||||
if "owned_private_repos" in attributes and attributes[ "owned_private_repos" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "owned_private_repos" ], int )
|
||||
self.__owned_private_repos = attributes[ "owned_private_repos" ]
|
||||
if "plan" in attributes and attributes[ "plan" ] is not None:
|
||||
if "plan" in attributes and attributes[ "plan" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "plan" ], dict )
|
||||
self.__plan = Plan.Plan( self.__requester, attributes[ "plan" ], completion = LazyCompletion )
|
||||
if "private_gists" in attributes and attributes[ "private_gists" ] is not None:
|
||||
if "private_gists" in attributes and attributes[ "private_gists" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "private_gists" ], int )
|
||||
self.__private_gists = attributes[ "private_gists" ]
|
||||
if "public_gists" in attributes and attributes[ "public_gists" ] is not None:
|
||||
if "public_gists" in attributes and attributes[ "public_gists" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "public_gists" ], int )
|
||||
self.__public_gists = attributes[ "public_gists" ]
|
||||
if "public_repos" in attributes and attributes[ "public_repos" ] is not None:
|
||||
if "public_repos" in attributes and attributes[ "public_repos" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "public_repos" ], int )
|
||||
self.__public_repos = attributes[ "public_repos" ]
|
||||
if "total_private_repos" in attributes and attributes[ "total_private_repos" ] is not None:
|
||||
if "total_private_repos" in attributes and attributes[ "total_private_repos" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "total_private_repos" ], int )
|
||||
self.__total_private_repos = attributes[ "total_private_repos" ]
|
||||
if "type" in attributes and attributes[ "type" ] is not None:
|
||||
if "type" in attributes and attributes[ "type" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "type" ], ( str, unicode ) )
|
||||
self.__type = attributes[ "type" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
+24
-24
@@ -390,75 +390,75 @@ class Organization( object ):
|
||||
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", ], 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:
|
||||
if "avatar_url" in attributes and attributes[ "avatar_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) )
|
||||
self.__avatar_url = attributes[ "avatar_url" ]
|
||||
if "billing_email" in attributes and attributes[ "billing_email" ] is not None:
|
||||
if "billing_email" in attributes and attributes[ "billing_email" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "billing_email" ], ( str, unicode ) )
|
||||
self.__billing_email = attributes[ "billing_email" ]
|
||||
if "blog" in attributes and attributes[ "blog" ] is not None:
|
||||
if "blog" in attributes and attributes[ "blog" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "blog" ], ( str, unicode ) )
|
||||
self.__blog = attributes[ "blog" ]
|
||||
if "collaborators" in attributes and attributes[ "collaborators" ] is not None:
|
||||
if "collaborators" in attributes and attributes[ "collaborators" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "collaborators" ], int )
|
||||
self.__collaborators = attributes[ "collaborators" ]
|
||||
if "company" in attributes and attributes[ "company" ] is not None:
|
||||
if "company" in attributes and attributes[ "company" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "company" ], ( str, unicode ) )
|
||||
self.__company = attributes[ "company" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "created_at" ], ( str, unicode ) )
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "disk_usage" in attributes and attributes[ "disk_usage" ] is not None:
|
||||
if "disk_usage" in attributes and attributes[ "disk_usage" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "disk_usage" ], int )
|
||||
self.__disk_usage = attributes[ "disk_usage" ]
|
||||
if "email" in attributes and attributes[ "email" ] is not None:
|
||||
if "email" in attributes and attributes[ "email" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "email" ], ( str, unicode ) )
|
||||
self.__email = attributes[ "email" ]
|
||||
if "followers" in attributes and attributes[ "followers" ] is not None:
|
||||
if "followers" in attributes and attributes[ "followers" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "followers" ], int )
|
||||
self.__followers = attributes[ "followers" ]
|
||||
if "following" in attributes and attributes[ "following" ] is not None:
|
||||
if "following" in attributes and attributes[ "following" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "following" ], int )
|
||||
self.__following = attributes[ "following" ]
|
||||
if "gravatar_id" in attributes and attributes[ "gravatar_id" ] is not None:
|
||||
if "gravatar_id" in attributes and attributes[ "gravatar_id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "gravatar_id" ], ( str, unicode ) )
|
||||
self.__gravatar_id = attributes[ "gravatar_id" ]
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "html_url" ], ( str, unicode ) )
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "id" ], int )
|
||||
self.__id = attributes[ "id" ]
|
||||
if "location" in attributes and attributes[ "location" ] is not None:
|
||||
if "location" in attributes and attributes[ "location" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "location" ], ( str, unicode ) )
|
||||
self.__location = attributes[ "location" ]
|
||||
if "login" in attributes and attributes[ "login" ] is not None:
|
||||
if "login" in attributes and attributes[ "login" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "login" ], ( str, unicode ) )
|
||||
self.__login = attributes[ "login" ]
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "name" ], ( str, unicode ) )
|
||||
self.__name = attributes[ "name" ]
|
||||
if "owned_private_repos" in attributes and attributes[ "owned_private_repos" ] is not None:
|
||||
if "owned_private_repos" in attributes and attributes[ "owned_private_repos" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "owned_private_repos" ], int )
|
||||
self.__owned_private_repos = attributes[ "owned_private_repos" ]
|
||||
if "plan" in attributes and attributes[ "plan" ] is not None:
|
||||
if "plan" in attributes and attributes[ "plan" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "plan" ], dict )
|
||||
self.__plan = Plan.Plan( self.__requester, attributes[ "plan" ], completion = LazyCompletion )
|
||||
if "private_gists" in attributes and attributes[ "private_gists" ] is not None:
|
||||
if "private_gists" in attributes and attributes[ "private_gists" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "private_gists" ], int )
|
||||
self.__private_gists = attributes[ "private_gists" ]
|
||||
if "public_gists" in attributes and attributes[ "public_gists" ] is not None:
|
||||
if "public_gists" in attributes and attributes[ "public_gists" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "public_gists" ], int )
|
||||
self.__public_gists = attributes[ "public_gists" ]
|
||||
if "public_repos" in attributes and attributes[ "public_repos" ] is not None:
|
||||
if "public_repos" in attributes and attributes[ "public_repos" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "public_repos" ], int )
|
||||
self.__public_repos = attributes[ "public_repos" ]
|
||||
if "total_private_repos" in attributes and attributes[ "total_private_repos" ] is not None:
|
||||
if "total_private_repos" in attributes and attributes[ "total_private_repos" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "total_private_repos" ], int )
|
||||
self.__total_private_repos = attributes[ "total_private_repos" ]
|
||||
if "type" in attributes and attributes[ "type" ] is not None:
|
||||
if "type" in attributes and attributes[ "type" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "type" ], ( str, unicode ) )
|
||||
self.__type = attributes[ "type" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -32,12 +32,12 @@ class Permissions( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "admin" in attributes and attributes[ "admin" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "admin" ], bool )
|
||||
self.__admin = attributes[ "admin" ]
|
||||
if "pull" in attributes and attributes[ "pull" ] is not None:
|
||||
if "pull" in attributes and attributes[ "pull" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "pull" ], bool )
|
||||
self.__pull = attributes[ "pull" ]
|
||||
if "push" in attributes and attributes[ "push" ] is not None:
|
||||
if "push" in attributes and attributes[ "push" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "push" ], bool )
|
||||
self.__push = attributes[ "push" ]
|
||||
|
||||
+4
-4
@@ -37,15 +37,15 @@ class Plan( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "collaborators" in attributes and attributes[ "collaborators" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "collaborators" ], int )
|
||||
self.__collaborators = attributes[ "collaborators" ]
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "name" ], ( str, unicode ) )
|
||||
self.__name = attributes[ "name" ]
|
||||
if "private_repos" in attributes and attributes[ "private_repos" ] is not None:
|
||||
if "private_repos" in attributes and attributes[ "private_repos" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "private_repos" ], int )
|
||||
self.__private_repos = attributes[ "private_repos" ]
|
||||
if "space" in attributes and attributes[ "space" ] is not None:
|
||||
if "space" in attributes and attributes[ "space" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "space" ], int )
|
||||
self.__space = attributes[ "space" ]
|
||||
|
||||
+26
-26
@@ -279,56 +279,56 @@ class PullRequest( object ):
|
||||
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", ], 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:
|
||||
if "additions" in attributes and attributes[ "additions" ] is not None: # pragma no branch
|
||||
self.__additions = attributes[ "additions" ]
|
||||
if "base" in attributes and attributes[ "base" ] is not None:
|
||||
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:
|
||||
if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch
|
||||
self.__body = attributes[ "body" ]
|
||||
if "changed_files" in attributes and attributes[ "changed_files" ] is not None:
|
||||
if "changed_files" in attributes and attributes[ "changed_files" ] is not None: # pragma no branch
|
||||
self.__changed_files = attributes[ "changed_files" ]
|
||||
if "closed_at" in attributes and attributes[ "closed_at" ] is not None:
|
||||
if "closed_at" in attributes and attributes[ "closed_at" ] is not None: # pragma no branch
|
||||
self.__closed_at = attributes[ "closed_at" ]
|
||||
if "comments" in attributes and attributes[ "comments" ] is not None:
|
||||
if "comments" in attributes and attributes[ "comments" ] is not None: # pragma no branch
|
||||
self.__comments = attributes[ "comments" ]
|
||||
if "commits" in attributes and attributes[ "commits" ] is not None:
|
||||
if "commits" in attributes and attributes[ "commits" ] is not None: # pragma no branch
|
||||
self.__commits = attributes[ "commits" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "deletions" in attributes and attributes[ "deletions" ] is not None:
|
||||
if "deletions" in attributes and attributes[ "deletions" ] is not None: # pragma no branch
|
||||
self.__deletions = attributes[ "deletions" ]
|
||||
if "diff_url" in attributes and attributes[ "diff_url" ] is not None:
|
||||
if "diff_url" in attributes and attributes[ "diff_url" ] is not None: # pragma no branch
|
||||
self.__diff_url = attributes[ "diff_url" ]
|
||||
if "head" in attributes and attributes[ "head" ] is not None:
|
||||
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:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
self.__id = attributes[ "id" ]
|
||||
if "issue_url" in attributes and attributes[ "issue_url" ] is not None:
|
||||
if "issue_url" in attributes and attributes[ "issue_url" ] is not None: # pragma no branch
|
||||
self.__issue_url = attributes[ "issue_url" ]
|
||||
if "mergeable" in attributes and attributes[ "mergeable" ] is not None:
|
||||
if "mergeable" in attributes and attributes[ "mergeable" ] is not None: # pragma no branch
|
||||
self.__mergeable = attributes[ "mergeable" ]
|
||||
if "merged" in attributes and attributes[ "merged" ] is not None:
|
||||
if "merged" in attributes and attributes[ "merged" ] is not None: # pragma no branch
|
||||
self.__merged = attributes[ "merged" ]
|
||||
if "merged_at" in attributes and attributes[ "merged_at" ] is not None:
|
||||
if "merged_at" in attributes and attributes[ "merged_at" ] is not None: # pragma no branch
|
||||
self.__merged_at = attributes[ "merged_at" ]
|
||||
if "merged_by" in attributes and attributes[ "merged_by" ] is not None:
|
||||
if "merged_by" in attributes and attributes[ "merged_by" ] is not None: # pragma no branch
|
||||
self.__merged_by = attributes[ "merged_by" ]
|
||||
if "number" in attributes and attributes[ "number" ] is not None:
|
||||
if "number" in attributes and attributes[ "number" ] is not None: # pragma no branch
|
||||
self.__number = attributes[ "number" ]
|
||||
if "patch_url" in attributes and attributes[ "patch_url" ] is not None:
|
||||
if "patch_url" in attributes and attributes[ "patch_url" ] is not None: # pragma no branch
|
||||
self.__patch_url = attributes[ "patch_url" ]
|
||||
if "review_comments" in attributes and attributes[ "review_comments" ] is not None:
|
||||
if "review_comments" in attributes and attributes[ "review_comments" ] is not None: # pragma no branch
|
||||
self.__review_comments = attributes[ "review_comments" ]
|
||||
if "state" in attributes and attributes[ "state" ] is not None:
|
||||
if "state" in attributes and attributes[ "state" ] is not None: # pragma no branch
|
||||
self.__state = attributes[ "state" ]
|
||||
if "title" in attributes and attributes[ "title" ] is not None:
|
||||
if "title" in attributes and attributes[ "title" ] is not None: # pragma no branch
|
||||
self.__title = attributes[ "title" ]
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "user" ], dict )
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion )
|
||||
|
||||
@@ -121,26 +121,26 @@ class PullRequestComment( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "body" in attributes and attributes[ "body" ] is not None: # pragma no branch
|
||||
self.__body = attributes[ "body" ]
|
||||
if "commit_id" in attributes and attributes[ "commit_id" ] is not None:
|
||||
if "commit_id" in attributes and attributes[ "commit_id" ] is not None: # pragma no branch
|
||||
self.__commit_id = attributes[ "commit_id" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
self.__id = attributes[ "id" ]
|
||||
if "line" in attributes and attributes[ "line" ] is not None:
|
||||
if "line" in attributes and attributes[ "line" ] is not None: # pragma no branch
|
||||
self.__line = attributes[ "line" ]
|
||||
if "path" in attributes and attributes[ "path" ] is not None:
|
||||
if "path" in attributes and attributes[ "path" ] is not None: # pragma no branch
|
||||
self.__path = attributes[ "path" ]
|
||||
if "position" in attributes and attributes[ "position" ] is not None:
|
||||
if "position" in attributes and attributes[ "position" ] is not None: # pragma no branch
|
||||
self.__position = attributes[ "position" ]
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
self.__url = attributes[ "url" ]
|
||||
if "user" in attributes and attributes[ "user" ] is not None:
|
||||
if "user" in attributes and attributes[ "user" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "user" ], dict )
|
||||
self.__user = NamedUser.NamedUser( self.__requester, attributes[ "user" ], completion = LazyCompletion )
|
||||
|
||||
@@ -62,21 +62,21 @@ class PullRequestFile( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "additions" in attributes and attributes[ "additions" ] is not None: # pragma no branch
|
||||
self.__additions = attributes[ "additions" ]
|
||||
if "blob_url" in attributes and attributes[ "blob_url" ] is not None:
|
||||
if "blob_url" in attributes and attributes[ "blob_url" ] is not None: # pragma no branch
|
||||
self.__blob_url = attributes[ "blob_url" ]
|
||||
if "changes" in attributes and attributes[ "changes" ] is not None:
|
||||
if "changes" in attributes and attributes[ "changes" ] is not None: # pragma no branch
|
||||
self.__changes = attributes[ "changes" ]
|
||||
if "deletions" in attributes and attributes[ "deletions" ] is not None:
|
||||
if "deletions" in attributes and attributes[ "deletions" ] is not None: # pragma no branch
|
||||
self.__deletions = attributes[ "deletions" ]
|
||||
if "filename" in attributes and attributes[ "filename" ] is not None:
|
||||
if "filename" in attributes and attributes[ "filename" ] is not None: # pragma no branch
|
||||
self.__filename = attributes[ "filename" ]
|
||||
if "patch" in attributes and attributes[ "patch" ] is not None:
|
||||
if "patch" in attributes and attributes[ "patch" ] is not None: # pragma no branch
|
||||
self.__patch = attributes[ "patch" ]
|
||||
if "raw_url" in attributes and attributes[ "raw_url" ] is not None:
|
||||
if "raw_url" in attributes and attributes[ "raw_url" ] is not None: # pragma no branch
|
||||
self.__raw_url = attributes[ "raw_url" ]
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None:
|
||||
if "sha" in attributes and attributes[ "sha" ] is not None: # pragma no branch
|
||||
self.__sha = attributes[ "sha" ]
|
||||
if "status" in attributes and attributes[ "status" ] is not None:
|
||||
if "status" in attributes and attributes[ "status" ] is not None: # pragma no branch
|
||||
self.__status = attributes[ "status" ]
|
||||
|
||||
+31
-31
@@ -905,96 +905,96 @@ class Repository( object ):
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "clone_url", "created_at", "description", "fork", "forks", "full_name", "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:
|
||||
if "clone_url" in attributes and attributes[ "clone_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "clone_url" ], ( str, unicode ) )
|
||||
self.__clone_url = attributes[ "clone_url" ]
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None:
|
||||
if "created_at" in attributes and attributes[ "created_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "created_at" ], ( str, unicode ) )
|
||||
self.__created_at = attributes[ "created_at" ]
|
||||
if "description" in attributes and attributes[ "description" ] is not None:
|
||||
if "description" in attributes and attributes[ "description" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "description" ], ( str, unicode ) )
|
||||
self.__description = attributes[ "description" ]
|
||||
if "fork" in attributes and attributes[ "fork" ] is not None:
|
||||
if "fork" in attributes and attributes[ "fork" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "fork" ], bool )
|
||||
self.__fork = attributes[ "fork" ]
|
||||
if "forks" in attributes and attributes[ "forks" ] is not None:
|
||||
if "forks" in attributes and attributes[ "forks" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "forks" ], int )
|
||||
self.__forks = attributes[ "forks" ]
|
||||
if "full_name" in attributes and attributes[ "full_name" ] is not None:
|
||||
if "full_name" in attributes and attributes[ "full_name" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "full_name" ], ( str, unicode ) )
|
||||
self.__full_name = attributes[ "full_name" ]
|
||||
if "git_url" in attributes and attributes[ "git_url" ] is not None:
|
||||
if "git_url" in attributes and attributes[ "git_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "git_url" ], ( str, unicode ) )
|
||||
self.__git_url = attributes[ "git_url" ]
|
||||
if "has_downloads" in attributes and attributes[ "has_downloads" ] is not None:
|
||||
if "has_downloads" in attributes and attributes[ "has_downloads" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "has_downloads" ], bool )
|
||||
self.__has_downloads = attributes[ "has_downloads" ]
|
||||
if "has_issues" in attributes and attributes[ "has_issues" ] is not None:
|
||||
if "has_issues" in attributes and attributes[ "has_issues" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "has_issues" ], bool )
|
||||
self.__has_issues = attributes[ "has_issues" ]
|
||||
if "has_wiki" in attributes and attributes[ "has_wiki" ] is not None:
|
||||
if "has_wiki" in attributes and attributes[ "has_wiki" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "has_wiki" ], bool )
|
||||
self.__has_wiki = attributes[ "has_wiki" ]
|
||||
if "homepage" in attributes and attributes[ "homepage" ] is not None:
|
||||
if "homepage" in attributes and attributes[ "homepage" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "homepage" ], ( str, unicode ) )
|
||||
self.__homepage = attributes[ "homepage" ]
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None:
|
||||
if "html_url" in attributes and attributes[ "html_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "html_url" ], ( str, unicode ) )
|
||||
self.__html_url = attributes[ "html_url" ]
|
||||
if "id" in attributes and attributes[ "id" ] is not None:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "id" ], int )
|
||||
self.__id = attributes[ "id" ]
|
||||
if "language" in attributes and attributes[ "language" ] is not None:
|
||||
if "language" in attributes and attributes[ "language" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "language" ], ( str, unicode ) )
|
||||
self.__language = attributes[ "language" ]
|
||||
if "master_branch" in attributes and attributes[ "master_branch" ] is not None:
|
||||
if "master_branch" in attributes and attributes[ "master_branch" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "master_branch" ], ( str, unicode ) )
|
||||
self.__master_branch = attributes[ "master_branch" ]
|
||||
if "mirror_url" in attributes and attributes[ "mirror_url" ] is not None:
|
||||
if "mirror_url" in attributes and attributes[ "mirror_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "mirror_url" ], ( str, unicode ) )
|
||||
self.__mirror_url = attributes[ "mirror_url" ]
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "name" ], ( str, unicode ) )
|
||||
self.__name = attributes[ "name" ]
|
||||
if "open_issues" in attributes and attributes[ "open_issues" ] is not None:
|
||||
if "open_issues" in attributes and attributes[ "open_issues" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "open_issues" ], int )
|
||||
self.__open_issues = attributes[ "open_issues" ]
|
||||
if "organization" in attributes and attributes[ "organization" ] is not None:
|
||||
if "organization" in attributes and attributes[ "organization" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "organization" ], dict )
|
||||
self.__organization = Organization.Organization( self.__requester, attributes[ "organization" ], completion = LazyCompletion )
|
||||
if "owner" in attributes and attributes[ "owner" ] is not None:
|
||||
if "owner" in attributes and attributes[ "owner" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "owner" ], dict )
|
||||
self.__owner = NamedUser.NamedUser( self.__requester, attributes[ "owner" ], completion = LazyCompletion )
|
||||
if "parent" in attributes and attributes[ "parent" ] is not None:
|
||||
if "parent" in attributes and attributes[ "parent" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "parent" ], dict )
|
||||
self.__parent = Repository( self.__requester, attributes[ "parent" ], completion = LazyCompletion )
|
||||
if "permissions" in attributes and attributes[ "permissions" ] is not None:
|
||||
if "permissions" in attributes and attributes[ "permissions" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "permissions" ], dict )
|
||||
self.__permissions = Permissions.Permissions( self.__requester, attributes[ "permissions" ], completion = LazyCompletion )
|
||||
if "private" in attributes and attributes[ "private" ] is not None:
|
||||
if "private" in attributes and attributes[ "private" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "private" ], bool )
|
||||
self.__private = attributes[ "private" ]
|
||||
if "pushed_at" in attributes and attributes[ "pushed_at" ] is not None:
|
||||
if "pushed_at" in attributes and attributes[ "pushed_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "pushed_at" ], ( str, unicode ) )
|
||||
self.__pushed_at = attributes[ "pushed_at" ]
|
||||
if "size" in attributes and attributes[ "size" ] is not None:
|
||||
if "size" in attributes and attributes[ "size" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "size" ], int )
|
||||
self.__size = attributes[ "size" ]
|
||||
if "source" in attributes and attributes[ "source" ] is not None:
|
||||
if "source" in attributes and attributes[ "source" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "source" ], dict )
|
||||
self.__source = Repository( self.__requester, attributes[ "source" ], completion = LazyCompletion )
|
||||
if "ssh_url" in attributes and attributes[ "ssh_url" ] is not None:
|
||||
if "ssh_url" in attributes and attributes[ "ssh_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "ssh_url" ], ( str, unicode ) )
|
||||
self.__ssh_url = attributes[ "ssh_url" ]
|
||||
if "svn_url" in attributes and attributes[ "svn_url" ] is not None:
|
||||
if "svn_url" in attributes and attributes[ "svn_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "svn_url" ], ( str, unicode ) )
|
||||
self.__svn_url = attributes[ "svn_url" ]
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None:
|
||||
if "updated_at" in attributes and attributes[ "updated_at" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "updated_at" ], ( str, unicode ) )
|
||||
self.__updated_at = attributes[ "updated_at" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "url" ], ( str, unicode ) )
|
||||
self.__url = attributes[ "url" ]
|
||||
if "watchers" in attributes and attributes[ "watchers" ] is not None:
|
||||
if "watchers" in attributes and attributes[ "watchers" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "watchers" ], int )
|
||||
self.__watchers = attributes[ "watchers" ]
|
||||
|
||||
@@ -87,14 +87,14 @@ class RepositoryKey( object ):
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "id", "key", "title", "url", "verified", ], 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:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
self.__id = attributes[ "id" ]
|
||||
if "key" in attributes and attributes[ "key" ] is not None:
|
||||
if "key" in attributes and attributes[ "key" ] is not None: # pragma no branch
|
||||
self.__key = attributes[ "key" ]
|
||||
if "title" in attributes and attributes[ "title" ] is not None:
|
||||
if "title" in attributes and attributes[ "title" ] is not None: # pragma no branch
|
||||
self.__title = attributes[ "title" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
self.__url = attributes[ "url" ]
|
||||
if "verified" in attributes and attributes[ "verified" ] is not None:
|
||||
if "verified" in attributes and attributes[ "verified" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "verified" ], bool )
|
||||
self.__verified = attributes[ "verified" ]
|
||||
|
||||
+4
-4
@@ -38,15 +38,15 @@ class Tag( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "commit" in attributes and attributes[ "commit" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "commit" ], dict )
|
||||
self.__commit = Commit.Commit( self.__requester, attributes[ "commit" ], completion = LazyCompletion )
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "name" ], ( str, unicode ) )
|
||||
self.__name = attributes[ "name" ]
|
||||
if "tarball_url" in attributes and attributes[ "tarball_url" ] is not None:
|
||||
if "tarball_url" in attributes and attributes[ "tarball_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "tarball_url" ], ( str, unicode ) )
|
||||
self.__tarball_url = attributes[ "tarball_url" ]
|
||||
if "zipball_url" in attributes and attributes[ "zipball_url" ] is not None:
|
||||
if "zipball_url" in attributes and attributes[ "zipball_url" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "zipball_url" ], ( str, unicode ) )
|
||||
self.__zipball_url = attributes[ "zipball_url" ]
|
||||
|
||||
+6
-6
@@ -172,15 +172,15 @@ class Team( object ):
|
||||
for attribute in attributes:
|
||||
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:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
self.__id = attributes[ "id" ]
|
||||
if "members_count" in attributes and attributes[ "members_count" ] is not None:
|
||||
if "members_count" in attributes and attributes[ "members_count" ] is not None: # pragma no branch
|
||||
self.__members_count = attributes[ "members_count" ]
|
||||
if "name" in attributes and attributes[ "name" ] is not None:
|
||||
if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch
|
||||
self.__name = attributes[ "name" ]
|
||||
if "permission" in attributes and attributes[ "permission" ] is not None:
|
||||
if "permission" in attributes and attributes[ "permission" ] is not None: # pragma no branch
|
||||
self.__permission = attributes[ "permission" ]
|
||||
if "repos_count" in attributes and attributes[ "repos_count" ] is not None:
|
||||
if "repos_count" in attributes and attributes[ "repos_count" ] is not None: # pragma no branch
|
||||
self.__repos_count = attributes[ "repos_count" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
self.__url = attributes[ "url" ]
|
||||
|
||||
@@ -87,14 +87,14 @@ class UserKey( object ):
|
||||
for attribute in attributes:
|
||||
assert attribute in [ "id", "key", "title", "url", "verified", ], 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:
|
||||
if "id" in attributes and attributes[ "id" ] is not None: # pragma no branch
|
||||
self.__id = attributes[ "id" ]
|
||||
if "key" in attributes and attributes[ "key" ] is not None:
|
||||
if "key" in attributes and attributes[ "key" ] is not None: # pragma no branch
|
||||
self.__key = attributes[ "key" ]
|
||||
if "title" in attributes and attributes[ "title" ] is not None:
|
||||
if "title" in attributes and attributes[ "title" ] is not None: # pragma no branch
|
||||
self.__title = attributes[ "title" ]
|
||||
if "url" in attributes and attributes[ "url" ] is not None:
|
||||
if "url" in attributes and attributes[ "url" ] is not None: # pragma no branch
|
||||
self.__url = attributes[ "url" ]
|
||||
if "verified" in attributes and attributes[ "verified" ] is not None:
|
||||
if "verified" in attributes and attributes[ "verified" ] is not None: # pragma no branch
|
||||
assert isinstance( attributes[ "verified" ], bool )
|
||||
self.__verified = attributes[ "verified" ]
|
||||
|
||||
Reference in New Issue
Block a user