From 0fb176fd7165ee398800426df95fa0e317c79f97 Mon Sep 17 00:00:00 2001 From: Darragh Bailey Date: Fri, 16 Mar 2018 14:49:01 +0000 Subject: [PATCH] Add url attribute to PullRequestReview object (#731) To compare PullRequestReview objects, they need to have the 'url' attribute because the CompletableGithubObject expects to be able to inspect a '_url' attribute on objects when testing for equality. --- github/PullRequestReview.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/github/PullRequestReview.py b/github/PullRequestReview.py index 9caf9b31..c390b042 100644 --- a/github/PullRequestReview.py +++ b/github/PullRequestReview.py @@ -79,6 +79,14 @@ class PullRequestReview(github.GithubObject.CompletableGithubObject): self._completeIfNotSet(self._state) return self._state.value + @property + def url(self): + """ + :type: string + """ + self._completeIfNotSet(self._url) + return self._url.value + @property def html_url(self): """ @@ -109,6 +117,7 @@ class PullRequestReview(github.GithubObject.CompletableGithubObject): self._body = github.GithubObject.NotSet self._commit_id = github.GithubObject.NotSet self._state = github.GithubObject.NotSet + self._url = github.GithubObject.NotSet self._html_url = github.GithubObject.NotSet self._pull_request_url = github.GithubObject.NotSet self._submitted_at = github.GithubObject.NotSet @@ -124,6 +133,8 @@ class PullRequestReview(github.GithubObject.CompletableGithubObject): self._commit_id = self._makeStringAttribute(attributes["commit_id"]) if "state" in attributes: # pragma no branch self._state = self._makeStringAttribute(attributes["state"]) + if "url" in attributes: # pragma no branch + self._url = self._makeStringAttribute(attributes["url"]) if "html_url" in attributes: # pragma no branch self._html_url = self._makeStringAttribute(attributes["html_url"]) if "pull_request_url" in attributes: # pragma no branch