From 855cc5dbd6354ac10374f177aa709d4c25060b3a Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 27 May 2012 12:19:45 +0100 Subject: [PATCH] Do not assert that we know all the attributes we receive --- .../description.000.human_readable.json | 1 - .../description.001.normalized.json | 8 -------- codegen/templates/GithubObject.py | 4 ---- doc/ReferenceOfClasses.md | 1 - src/github/AuthenticatedUser.py | 3 --- src/github/Authorization.py | 3 --- src/github/Branch.py | 3 --- src/github/Commit.py | 3 --- src/github/CommitComment.py | 3 --- src/github/CommitFile.py | 3 --- src/github/CommitStats.py | 3 --- src/github/Download.py | 3 --- src/github/Event.py | 3 --- src/github/Gist.py | 3 --- src/github/GistComment.py | 3 --- src/github/GistHistoryState.py | 3 --- src/github/GitAuthor.py | 3 --- src/github/GitBlob.py | 3 --- src/github/GitCommit.py | 3 --- src/github/GitObject.py | 3 --- src/github/GitRef.py | 3 --- src/github/GitTag.py | 3 --- src/github/GitTree.py | 3 --- src/github/GitTreeElement.py | 3 --- src/github/Hook.py | 3 --- src/github/Issue.py | 3 --- src/github/IssueComment.py | 3 --- src/github/IssueEvent.py | 3 --- src/github/Label.py | 3 --- src/github/Milestone.py | 3 --- src/github/NamedUser.py | 3 --- src/github/Organization.py | 3 --- src/github/Permissions.py | 3 --- src/github/Plan.py | 3 --- src/github/PullRequest.py | 3 --- src/github/PullRequestComment.py | 3 --- src/github/PullRequestFile.py | 3 --- src/github/Repository.py | 3 --- src/github/RepositoryKey.py | 3 --- src/github/Tag.py | 3 --- src/github/Team.py | 3 --- src/github/UserKey.py | 3 --- 42 files changed, 128 deletions(-) diff --git a/codegen/JsonDescriptionOfGithubApiV3/description.000.human_readable.json b/codegen/JsonDescriptionOfGithubApiV3/description.000.human_readable.json index 70a72c44..c6c0aa97 100644 --- a/codegen/JsonDescriptionOfGithubApiV3/description.000.human_readable.json +++ b/codegen/JsonDescriptionOfGithubApiV3/description.000.human_readable.json @@ -1259,7 +1259,6 @@ { "name": "id", "type": "integer" }, { "name": "language", "type": "string" }, { "name": "master_branch", "type": "string" }, - { "name": "mirror_url", "type": "string" }, { "name": "name", "type": "string" }, { "name": "open_issues", "type": "integer" }, { "name": "organization", "type": "Organization" }, diff --git a/codegen/JsonDescriptionOfGithubApiV3/description.001.normalized.json b/codegen/JsonDescriptionOfGithubApiV3/description.001.normalized.json index 23ef4d5d..eb3771b9 100644 --- a/codegen/JsonDescriptionOfGithubApiV3/description.001.normalized.json +++ b/codegen/JsonDescriptionOfGithubApiV3/description.001.normalized.json @@ -7293,14 +7293,6 @@ }, "name": "master_branch" }, - { - "type": { - "simple": true, - "cardinality": "scalar", - "name": "string" - }, - "name": "mirror_url" - }, { "type": { "simple": true, diff --git a/codegen/templates/GithubObject.py b/codegen/templates/GithubObject.py index fb485590..6215d121 100644 --- a/codegen/templates/GithubObject.py +++ b/codegen/templates/GithubObject.py @@ -64,10 +64,6 @@ class {{ class.name }}( object ): {% endif %} def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ {% for attribute in class.attributes|dictsort:"name" %}"{{ attribute.name }}", {% endfor %}], attribute - # @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: # pragma no branch diff --git a/doc/ReferenceOfClasses.md b/doc/ReferenceOfClasses.md index 06cb54cd..87faca25 100644 --- a/doc/ReferenceOfClasses.md +++ b/doc/ReferenceOfClasses.md @@ -957,7 +957,6 @@ Attributes * `id`: integer * `language`: string * `master_branch`: string -* `mirror_url`: string * `name`: string * `open_issues`: integer * `organization`: `Organization` diff --git a/src/github/AuthenticatedUser.py b/src/github/AuthenticatedUser.py index 502f6570..d6a5babf 100644 --- a/src/github/AuthenticatedUser.py +++ b/src/github/AuthenticatedUser.py @@ -564,9 +564,6 @@ class AuthenticatedUser( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "avatar_url", "bio", "blog", "collaborators", "company", "created_at", "disk_usage", "email", "followers", "following", "gravatar_id", "hireable", "html_url", "id", "location", "login", "name", "owned_private_repos", "plan", "private_gists", "public_gists", "public_repos", "total_private_repos", "type", "url", ], 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: # pragma no branch assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) ) diff --git a/src/github/Authorization.py b/src/github/Authorization.py index 2c2e7ad5..2b7b1442 100644 --- a/src/github/Authorization.py +++ b/src/github/Authorization.py @@ -113,9 +113,6 @@ class Authorization( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "app", "created_at", "id", "note", "note_url", "scopes", "token", "updated_at", "url", ], 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: # pragma no branch self.__app = attributes[ "app" ] diff --git a/src/github/Branch.py b/src/github/Branch.py index 96ae9647..b71d37ec 100644 --- a/src/github/Branch.py +++ b/src/github/Branch.py @@ -24,9 +24,6 @@ class Branch( object ): self.__name = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "commit", "name", ], 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: # pragma no branch assert isinstance( attributes[ "commit" ], dict ) diff --git a/src/github/Commit.py b/src/github/Commit.py index bef13928..a7cde039 100644 --- a/src/github/Commit.py +++ b/src/github/Commit.py @@ -116,9 +116,6 @@ class Commit( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "author", "commit", "committer", "files", "parents", "sha", "stats", "url", ], 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: # pragma no branch assert isinstance( attributes[ "author" ], dict ) diff --git a/src/github/CommitComment.py b/src/github/CommitComment.py index 6e95e0ba..f4c2c67a 100644 --- a/src/github/CommitComment.py +++ b/src/github/CommitComment.py @@ -117,9 +117,6 @@ class CommitComment( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "body", "commit_id", "created_at", "html_url", "id", "line", "path", "position", "updated_at", "url", "user", ], 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: # pragma no branch assert isinstance( attributes[ "body" ], ( str, unicode ) ) diff --git a/src/github/CommitFile.py b/src/github/CommitFile.py index 27185b98..8469636d 100644 --- a/src/github/CommitFile.py +++ b/src/github/CommitFile.py @@ -58,9 +58,6 @@ class CommitFile( object ): self.__status = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "additions", "blob_url", "changes", "deletions", "filename", "patch", "raw_url", "sha", "status", ], 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: # pragma no branch self.__additions = attributes[ "additions" ] diff --git a/src/github/CommitStats.py b/src/github/CommitStats.py index 772d0eed..e663c60c 100644 --- a/src/github/CommitStats.py +++ b/src/github/CommitStats.py @@ -28,9 +28,6 @@ class CommitStats( object ): self.__total = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "additions", "deletions", "total", ], 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: # pragma no branch assert isinstance( attributes[ "additions" ], int ) diff --git a/src/github/Download.py b/src/github/Download.py index 28c49231..f47c95f8 100644 --- a/src/github/Download.py +++ b/src/github/Download.py @@ -158,9 +158,6 @@ class Download( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "accesskeyid", "acl", "bucket", "content_type", "created_at", "description", "download_count", "expirationdate", "html_url", "id", "mime_type", "name", "path", "policy", "prefix", "redirect", "s3_url", "signature", "size", "url", "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: # pragma no branch self.__accesskeyid = attributes[ "accesskeyid" ] diff --git a/src/github/Event.py b/src/github/Event.py index f04618e5..ca639d35 100644 --- a/src/github/Event.py +++ b/src/github/Event.py @@ -56,9 +56,6 @@ class Event( object ): self.__type = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "actor", "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: # pragma no branch assert isinstance( attributes[ "actor" ], dict ) diff --git a/src/github/Gist.py b/src/github/Gist.py index 56bd080c..c4c01a88 100644 --- a/src/github/Gist.py +++ b/src/github/Gist.py @@ -216,9 +216,6 @@ class Gist( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "comments", "created_at", "description", "files", "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: # pragma no branch assert isinstance( attributes[ "comments" ], int ) diff --git a/src/github/GistComment.py b/src/github/GistComment.py index a595ca28..ccaa9e57 100644 --- a/src/github/GistComment.py +++ b/src/github/GistComment.py @@ -64,9 +64,6 @@ class GistComment( object ): self.__user = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "body", "created_at", "id", "updated_at", "url", "user", ], 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: # pragma no branch self.__body = attributes[ "body" ] diff --git a/src/github/GistHistoryState.py b/src/github/GistHistoryState.py index d325a2b1..0cdf588f 100644 --- a/src/github/GistHistoryState.py +++ b/src/github/GistHistoryState.py @@ -40,9 +40,6 @@ class GistHistoryState( object ): self.__version = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "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: # pragma no branch assert isinstance( attributes[ "change_status" ], dict ) diff --git a/src/github/GitAuthor.py b/src/github/GitAuthor.py index 2c710f56..718993ca 100644 --- a/src/github/GitAuthor.py +++ b/src/github/GitAuthor.py @@ -28,9 +28,6 @@ class GitAuthor( object ): self.__name = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "date", "email", "name", ], 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: # pragma no branch assert isinstance( attributes[ "date" ], ( str, unicode ) ) diff --git a/src/github/GitBlob.py b/src/github/GitBlob.py index 4defbde8..7c8bbe67 100644 --- a/src/github/GitBlob.py +++ b/src/github/GitBlob.py @@ -38,9 +38,6 @@ class GitBlob( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "content", "encoding", "sha", "size", "url", ], 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: # pragma no branch assert isinstance( attributes[ "content" ], ( str, unicode ) ) diff --git a/src/github/GitCommit.py b/src/github/GitCommit.py index 13382cd7..742c399f 100644 --- a/src/github/GitCommit.py +++ b/src/github/GitCommit.py @@ -51,9 +51,6 @@ class GitCommit( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "author", "committer", "message", "parents", "sha", "tree", "url", ], 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: # pragma no branch assert isinstance( attributes[ "author" ], dict ) diff --git a/src/github/GitObject.py b/src/github/GitObject.py index 05e3067c..2adb574d 100644 --- a/src/github/GitObject.py +++ b/src/github/GitObject.py @@ -28,9 +28,6 @@ class GitObject( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "sha", "type", "url", ], 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: # pragma no branch assert isinstance( attributes[ "sha" ], ( str, unicode ) ) diff --git a/src/github/GitRef.py b/src/github/GitRef.py index bfc8d913..2fbd5b5b 100644 --- a/src/github/GitRef.py +++ b/src/github/GitRef.py @@ -51,9 +51,6 @@ class GitRef( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "object", "ref", "url", ], 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: # pragma no branch assert isinstance( attributes[ "object" ], dict ) diff --git a/src/github/GitTag.py b/src/github/GitTag.py index 532d3a05..94d6bdce 100644 --- a/src/github/GitTag.py +++ b/src/github/GitTag.py @@ -45,9 +45,6 @@ class GitTag( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "message", "object", "sha", "tag", "tagger", "url", ], 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: # pragma no branch assert isinstance( attributes[ "message" ], ( str, unicode ) ) diff --git a/src/github/GitTree.py b/src/github/GitTree.py index 321f54fc..bcec07f8 100644 --- a/src/github/GitTree.py +++ b/src/github/GitTree.py @@ -29,9 +29,6 @@ class GitTree( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "sha", "tree", "url", ], 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: # pragma no branch assert isinstance( attributes[ "sha" ], ( str, unicode ) ) diff --git a/src/github/GitTreeElement.py b/src/github/GitTreeElement.py index 97ff0700..5260d7a0 100644 --- a/src/github/GitTreeElement.py +++ b/src/github/GitTreeElement.py @@ -43,9 +43,6 @@ class GitTreeElement( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "mode", "path", "sha", "size", "type", "url", ], 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: # pragma no branch assert isinstance( attributes[ "mode" ], ( str, unicode ) ) diff --git a/src/github/Hook.py b/src/github/Hook.py index 9ac71aa2..8d6c939c 100644 --- a/src/github/Hook.py +++ b/src/github/Hook.py @@ -95,9 +95,6 @@ class Hook( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "active", "config", "created_at", "events", "id", "last_response", "name", "updated_at", "url", ], 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: # pragma no branch self.__active = attributes[ "active" ] diff --git a/src/github/Issue.py b/src/github/Issue.py index 8c104408..fb9c9f1b 100644 --- a/src/github/Issue.py +++ b/src/github/Issue.py @@ -264,9 +264,6 @@ class Issue( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "assignee", "body", "closed_at", "closed_by", "comments", "created_at", "html_url", "id", "labels", "milestone", "number", "pull_request", "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: # pragma no branch assert isinstance( attributes[ "assignee" ], dict ) diff --git a/src/github/IssueComment.py b/src/github/IssueComment.py index 5ed8d8d1..9d44e11d 100644 --- a/src/github/IssueComment.py +++ b/src/github/IssueComment.py @@ -64,9 +64,6 @@ class IssueComment( object ): self.__user = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "body", "created_at", "id", "updated_at", "url", "user", ], 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: # pragma no branch self.__body = attributes[ "body" ] diff --git a/src/github/IssueEvent.py b/src/github/IssueEvent.py index a276fe9e..5dcda3a2 100644 --- a/src/github/IssueEvent.py +++ b/src/github/IssueEvent.py @@ -74,9 +74,6 @@ class IssueEvent( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "actor", "commit_id", "created_at", "event", "id", "issue", "url", ], 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: # pragma no branch assert isinstance( attributes[ "actor" ], dict ) diff --git a/src/github/Label.py b/src/github/Label.py index 1f11c4d9..64acc1c1 100644 --- a/src/github/Label.py +++ b/src/github/Label.py @@ -56,9 +56,6 @@ class Label( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "color", "name", "url", ], 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: # pragma no branch self.__color = attributes[ "color" ] diff --git a/src/github/Milestone.py b/src/github/Milestone.py index ffbb51b8..6d390134 100644 --- a/src/github/Milestone.py +++ b/src/github/Milestone.py @@ -110,9 +110,6 @@ class Milestone( object ): self.__url = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "closed_issues", "created_at", "creator", "description", "due_on", "id", "number", "open_issues", "state", "title", "url", ], 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: # pragma no branch assert isinstance( attributes[ "closed_issues" ], int ) diff --git a/src/github/NamedUser.py b/src/github/NamedUser.py index 61400ed1..8b3b8427 100644 --- a/src/github/NamedUser.py +++ b/src/github/NamedUser.py @@ -361,9 +361,6 @@ class NamedUser( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "avatar_url", "bio", "blog", "collaborators", "company", "contributions", "created_at", "disk_usage", "email", "followers", "following", "gravatar_id", "hireable", "html_url", "id", "location", "login", "name", "owned_private_repos", "plan", "private_gists", "public_gists", "public_repos", "total_private_repos", "type", "url", ], 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: # pragma no branch assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) ) diff --git a/src/github/Organization.py b/src/github/Organization.py index 78ac913c..3c25307d 100644 --- a/src/github/Organization.py +++ b/src/github/Organization.py @@ -386,9 +386,6 @@ class Organization( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "avatar_url", "billing_email", "blog", "collaborators", "company", "created_at", "disk_usage", "email", "followers", "following", "gravatar_id", "html_url", "id", "location", "login", "name", "owned_private_repos", "plan", "private_gists", "public_gists", "public_repos", "total_private_repos", "type", "url", ], 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: # pragma no branch assert isinstance( attributes[ "avatar_url" ], ( str, unicode ) ) diff --git a/src/github/Permissions.py b/src/github/Permissions.py index 043f6f5d..90e3880b 100644 --- a/src/github/Permissions.py +++ b/src/github/Permissions.py @@ -28,9 +28,6 @@ class Permissions( object ): self.__push = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "admin", "pull", "push", ], 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: # pragma no branch assert isinstance( attributes[ "admin" ], bool ) diff --git a/src/github/Plan.py b/src/github/Plan.py index 14ac71bd..4cd55323 100644 --- a/src/github/Plan.py +++ b/src/github/Plan.py @@ -33,9 +33,6 @@ class Plan( object ): self.__space = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "collaborators", "name", "private_repos", "space", ], 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: # pragma no branch assert isinstance( attributes[ "collaborators" ], int ) diff --git a/src/github/PullRequest.py b/src/github/PullRequest.py index b44e205b..a4608e23 100644 --- a/src/github/PullRequest.py +++ b/src/github/PullRequest.py @@ -290,9 +290,6 @@ class PullRequest( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "additions", "base", "body", "changed_files", "closed_at", "comments", "commits", "created_at", "deletions", "diff_url", "head", "html_url", "id", "issue_url", "mergeable", "merged", "merged_at", "merged_by", "number", "patch_url", "review_comments", "state", "title", "updated_at", "url", "user", "_links", ], 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: # pragma no branch self.__additions = attributes[ "additions" ] diff --git a/src/github/PullRequestComment.py b/src/github/PullRequestComment.py index 7b39cd9a..45a016c6 100644 --- a/src/github/PullRequestComment.py +++ b/src/github/PullRequestComment.py @@ -117,9 +117,6 @@ class PullRequestComment( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "body", "commit_id", "created_at", "id", "original_commit_id", "original_position", "path", "position", "updated_at", "url", "user", "_links", ], 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: # pragma no branch self.__body = attributes[ "body" ] diff --git a/src/github/PullRequestFile.py b/src/github/PullRequestFile.py index 043fb9a5..82baa77c 100644 --- a/src/github/PullRequestFile.py +++ b/src/github/PullRequestFile.py @@ -58,9 +58,6 @@ class PullRequestFile( object ): self.__status = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "additions", "blob_url", "changes", "deletions", "filename", "patch", "raw_url", "sha", "status", ], 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: # pragma no branch self.__additions = attributes[ "additions" ] diff --git a/src/github/Repository.py b/src/github/Repository.py index c1c9c40d..5529d547 100644 --- a/src/github/Repository.py +++ b/src/github/Repository.py @@ -917,9 +917,6 @@ class Repository( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "clone_url", "created_at", "description", "fork", "forks", "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: # pragma no branch assert isinstance( attributes[ "clone_url" ], ( str, unicode ) ) diff --git a/src/github/RepositoryKey.py b/src/github/RepositoryKey.py index c6ad98e3..d6341016 100644 --- a/src/github/RepositoryKey.py +++ b/src/github/RepositoryKey.py @@ -83,9 +83,6 @@ class RepositoryKey( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "id", "key", "title", "url", "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: # pragma no branch self.__id = attributes[ "id" ] diff --git a/src/github/Tag.py b/src/github/Tag.py index 7903406c..74fe1397 100644 --- a/src/github/Tag.py +++ b/src/github/Tag.py @@ -34,9 +34,6 @@ class Tag( object ): self.__zipball_url = None def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "commit", "name", "tarball_url", "zipball_url", ], 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: # pragma no branch assert isinstance( attributes[ "commit" ], dict ) diff --git a/src/github/Team.py b/src/github/Team.py index ca5b7e13..3e29dbf8 100644 --- a/src/github/Team.py +++ b/src/github/Team.py @@ -168,9 +168,6 @@ class Team( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "id", "members_count", "name", "permission", "repos_count", "url", ], 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: # pragma no branch self.__id = attributes[ "id" ] diff --git a/src/github/UserKey.py b/src/github/UserKey.py index b7b135d5..d7a908a4 100644 --- a/src/github/UserKey.py +++ b/src/github/UserKey.py @@ -83,9 +83,6 @@ class UserKey( object ): self.__completed = True def __useAttributes( self, attributes ): - # @todo Remove this debug weakness: we shall assume that github will add new attributes - for attribute in attributes: - assert attribute in [ "id", "key", "title", "url", "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: # pragma no branch self.__id = attributes[ "id" ]