diff --git a/docs/source/release-notes/3.1.1.rst b/docs/source/release-notes/3.1.1.rst new file mode 100644 index 00000000..a8df6f44 --- /dev/null +++ b/docs/source/release-notes/3.1.1.rst @@ -0,0 +1,11 @@ +3.1.1: 2022-02-21 +----------------- + +Features Added +`````````````` + +- Support editing parent team and team visibility via + :meth:`github3.orgs.Team.edit` + +- Added more allowed statuses to Deployments for + :meth:`github3.repos.deployment.Deployment.create_status()` diff --git a/docs/source/release-notes/3.2.0.rst b/docs/source/release-notes/3.2.0.rst index 9e88a51d..cfd45b9e 100644 --- a/docs/source/release-notes/3.2.0.rst +++ b/docs/source/release-notes/3.2.0.rst @@ -8,9 +8,6 @@ Dependency Change Features Added `````````````` -- Added more allowed statuses to Deployments for - :meth:`github3.repos.deployment.Deployment.create_status()` - Bug Fixes ````````` diff --git a/docs/source/release-notes/index.rst b/docs/source/release-notes/index.rst index fb031f69..a27d99eb 100644 --- a/docs/source/release-notes/index.rst +++ b/docs/source/release-notes/index.rst @@ -10,6 +10,7 @@ here with the newest releases first. .. toctree:: 3.2.0 + 3.1.1 3.1.0 3.0.0 diff --git a/setup.cfg b/setup.cfg index 66aa61f2..18c64acf 100644 --- a/setup.cfg +++ b/setup.cfg @@ -23,6 +23,11 @@ classifiers = Programming Language :: Python :: 3.9 Programming Language :: Python :: 3.10 Programming Language :: Python :: Implementation :: CPython +project_urls = + Documentation = https://github3.readthedocs.io + Changelog = https://github3.readthedocs.io/en/latest/release-notes/index.html + Source = https://github3.com/sigmavirus24/github3.py + Released Versions = https://github.com/sigmavirus24/github3.py/tags requires_dist = requests>=2.0 uritemplate>=3.0.0 diff --git a/src/github3/__about__.py b/src/github3/__about__.py index a254606b..d5384f3e 100644 --- a/src/github3/__about__.py +++ b/src/github3/__about__.py @@ -5,7 +5,7 @@ __author_email__ = "graffatcolmingov@gmail.com" __license__ = "Modified BSD" __copyright__ = "Copyright 2012-2022 Ian Stapleton Cordasco" -__version__ = "3.1.0" +__version__ = "3.1.1" __version_info__ = tuple( int(i) for i in __version__.split(".") if i.isdigit() ) diff --git a/src/github3/orgs.py b/src/github3/orgs.py index dc801631..469371e5 100644 --- a/src/github3/orgs.py +++ b/src/github3/orgs.py @@ -118,20 +118,39 @@ def delete(self): return self._boolean(self._delete(self._api), 204, 404) @requires_auth - def edit(self, name, permission=""): + def edit( + self, + name: str, + permission: str = "", + parent_team_id: t.Optional[int] = None, + privacy: t.Optional[str] = None, + ): """Edit this team. :param str name: (required), the new name of this team :param str permission: (optional), one of ('pull', 'push', 'admin') + .. deprecated:: 3.0.0 + + This was deprecated by the GitHub API. + :param int parent_team_id: + (optional), id of the parent team for this team + :param str privacy: + (optional), one of "closed" or "secret" :returns: True if successful, False otherwise :rtype: bool """ if name: - data = {"name": name, "permission": permission} + data = {"name": name} + if permission: + data["permission"] = permission + if parent_team_id is not None: + data["parent_team_id"] = parent_team_id + if privacy in {"closed", "secret"}: + data["privacy"] = privacy json = self._json(self._patch(self._api, data=dumps(data)), 200) if json: self._update_attributes(json) diff --git a/tests/cassettes/Team_edit.json b/tests/cassettes/Team_edit.json index a4a40f33..bc7c9cb6 100644 --- a/tests/cassettes/Team_edit.json +++ b/tests/cassettes/Team_edit.json @@ -1 +1 @@ -{"http_interactions": [{"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["github3.py/3.0.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["application/vnd.github.v3.full+json"], "Connection": ["keep-alive"], "Accept-Charset": ["utf-8"], "Content-Type": ["application/json"], "Authorization": ["token "]}, "method": "GET", "uri": "https://api.github.com/orgs/github3py"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA51VTXPaMBD9K4zPYBsTIHgm0x6StjmkuWSmbS6etb02CrKkSjIuzeS/d2WbxCRkJpThYFb79uO9J/PocVky4cVeyey6Tmdq5409lnvxdHkeTeeLsSdkjomLeDeXV7vbzWp3H32p4ada51/5Nn24mt1eXv/5fvfrgpC15pS4tlaZOAhAMb+r62eyCqQuTTDso1FJk5yACVoE9cEtCnsatIMQdi3l5jRoi3C8GFPjadAOQtgKqxT1aeAe8xh0D09URtUpZ1nyP9UOocOisAUL+rUQbdD0AtYGdSaFJdpbLeugN8in7cUZzZWjyTRTlklnpm+yGSmUiuMorRnPR0YWtgGNPqUKqPDFcH7rOCqpQOwGYSYpnJI7vVjUnI/JqBn05W8gZ0aK8ejHNSVhBYxc12XZhlmLtAvN2zXq4swkW9SsYEhOLoAbJCOASciTINjftnKitHzAzBovtrruE1rHMSv17s1xT2jnyfj8WZySGVcjHHuF5Fw2JPvgFxO0Ep2tbcVfUT64K8NrkmkEi3kClviJwmk0CeeTaHkXnsXRPJ4t7omEWuUHOeeTcDmJpnfTVTyjb+hy7E454m8HK7uotMBpN0Z6Y9IvQ/PJRlDPt/F95GVLEmNDhENJ1edOS84hlRqItG7xlHFOaye9Ul6pfSgKH5yVuF8x4Zdy+7l0OjpztXYqoOa2G6dnH3VFt6kzWKOZRcrb34MMRNLR9AJhSN17qW0jkwIymojOf9dMY0VOTlBAygeO2JeDVrZ82L6t7kzSsyikeGeAoS3c6MM5jsx7wPAH8hldQrI2P77osQYkzLOlh+eF1JtDgT/Qvt9OvVe0V2G/1UGe4kBvh8f9G6DQ6Cg0CjJyzmq5mC+is9WK7tGhGachfegykYtIE0M60Dr0z9Q/hU9P/wAGD7D/xwYAAA==", "string": ""}, "headers": {"Server": ["GitHub.com"], "Date": ["Mon, 14 Feb 2022 15:11:29 GMT"], "Content-Type": ["application/json; charset=utf-8"], "Transfer-Encoding": ["chunked"], "Cache-Control": ["private, max-age=60, s-maxage=60"], "Vary": ["Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With"], "ETag": ["W/\"33bb9e34d4beb7fd3846af5913e6ff19663fce73ce0ff0f3bb03a1971e1be933\""], "Last-Modified": ["Sat, 21 Jul 2018 19:39:30 GMT"], "X-OAuth-Scopes": ["admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages"], "X-Accepted-OAuth-Scopes": ["admin:org, read:org, repo, user, write:org"], "github-authentication-token-expiration": ["2022-02-28 23:43:49 UTC"], "X-GitHub-Media-Type": ["github.v3; param=full; format=json"], "X-RateLimit-Limit": ["5000"], "X-RateLimit-Remaining": ["4969"], "X-RateLimit-Reset": ["1644852367"], "X-RateLimit-Used": ["31"], "X-RateLimit-Resource": ["core"], "Access-Control-Expose-Headers": ["ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset"], "Access-Control-Allow-Origin": ["*"], "Strict-Transport-Security": ["max-age=31536000; includeSubdomains; preload"], "X-Frame-Options": ["deny"], "X-Content-Type-Options": ["nosniff"], "X-XSS-Protection": ["0"], "Referrer-Policy": ["origin-when-cross-origin, strict-origin-when-cross-origin"], "Content-Security-Policy": ["default-src 'none'"], "Content-Encoding": ["gzip"], "X-GitHub-Request-Id": ["C494:0E6D:40390E3:A7BA240:620A7121"]}, "status": {"code": 200, "message": "OK"}, "url": "https://api.github.com/orgs/github3py"}, "recorded_at": "2022-02-14T15:11:29"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"edit-me\", \"repo_names\": [], \"maintainers\": [], \"permission\": \"pull\", \"privacy\": \"secret\"}"}, "headers": {"User-Agent": ["github3.py/3.0.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["application/vnd.github.v3.full+json"], "Connection": ["keep-alive"], "Accept-Charset": ["utf-8"], "Content-Type": ["application/json"], "Content-Length": ["99"], "Authorization": ["token "]}, "method": "POST", "uri": "https://api.github.com/orgs/github3py/teams"}, "response": {"body": {"encoding": "utf-8", "string": "{\"name\":\"edit-me\",\"id\":5678343,\"node_id\":\"T_kwDOABsxjM4AVqUH\",\"slug\":\"edit-me\",\"description\":null,\"privacy\":\"secret\",\"url\":\"https://api.github.com/organizations/1782156/team/5678343\",\"html_url\":\"https://github.com/orgs/github3py/teams/edit-me\",\"members_url\":\"https://api.github.com/organizations/1782156/team/5678343/members{/member}\",\"repositories_url\":\"https://api.github.com/organizations/1782156/team/5678343/repos\",\"permission\":\"pull\",\"parent\":null,\"created_at\":\"2022-02-14T15:11:29Z\",\"updated_at\":\"2022-02-14T15:11:29Z\",\"members_count\":1,\"repos_count\":0,\"organization\":{\"login\":\"github3py\",\"id\":1782156,\"node_id\":\"MDEyOk9yZ2FuaXphdGlvbjE3ODIxNTY=\",\"url\":\"https://api.github.com/orgs/github3py\",\"repos_url\":\"https://api.github.com/orgs/github3py/repos\",\"events_url\":\"https://api.github.com/orgs/github3py/events\",\"hooks_url\":\"https://api.github.com/orgs/github3py/hooks\",\"issues_url\":\"https://api.github.com/orgs/github3py/issues\",\"members_url\":\"https://api.github.com/orgs/github3py/members{/member}\",\"public_members_url\":\"https://api.github.com/orgs/github3py/public_members{/member}\",\"avatar_url\":\"https://avatars.githubusercontent.com/u/1782156?v=4\",\"description\":\"How people build software.\",\"name\":\"github3.py\",\"company\":\"github3.io\",\"blog\":\"\",\"location\":\"Madison, WI\",\"email\":null,\"twitter_username\":null,\"is_verified\":false,\"has_organization_projects\":true,\"has_repository_projects\":true,\"public_repos\":8,\"public_gists\":0,\"followers\":0,\"following\":0,\"html_url\":\"https://github.com/github3py\",\"created_at\":\"2012-05-27T04:25:36Z\",\"updated_at\":\"2018-07-21T19:39:30Z\",\"type\":\"Organization\"}}"}, "headers": {"Server": ["GitHub.com"], "Date": ["Mon, 14 Feb 2022 15:11:29 GMT"], "Content-Type": ["application/json; charset=utf-8"], "Content-Length": ["1600"], "Cache-Control": ["private, max-age=60, s-maxage=60"], "Vary": ["Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With"], "ETag": ["\"c1802cb0d860bc127e5827bedcbfd1751a52f9769ef4bf14d6794b95b4b74402\""], "X-OAuth-Scopes": ["admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages"], "X-Accepted-OAuth-Scopes": ["admin:org, repo"], "github-authentication-token-expiration": ["2022-02-28 23:43:49 UTC"], "Location": ["https://api.github.com/organizations/1782156/team/5678343"], "X-GitHub-Media-Type": ["github.v3; param=full; format=json"], "X-RateLimit-Limit": ["5000"], "X-RateLimit-Remaining": ["4968"], "X-RateLimit-Reset": ["1644852367"], "X-RateLimit-Used": ["32"], "X-RateLimit-Resource": ["core"], "Access-Control-Expose-Headers": ["ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset"], "Access-Control-Allow-Origin": ["*"], "Strict-Transport-Security": ["max-age=31536000; includeSubdomains; preload"], "X-Frame-Options": ["deny"], "X-Content-Type-Options": ["nosniff"], "X-XSS-Protection": ["0"], "Referrer-Policy": ["origin-when-cross-origin, strict-origin-when-cross-origin"], "Content-Security-Policy": ["default-src 'none'"], "X-GitHub-Request-Id": ["C494:0E6D:40390F8:A7BA26F:620A7121"]}, "status": {"code": 201, "message": "Created"}, "url": "https://api.github.com/orgs/github3py/teams"}, "recorded_at": "2022-02-14T15:11:29"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"delete-me\", \"permission\": \"\"}"}, "headers": {"User-Agent": ["github3.py/3.0.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["application/vnd.github.v3.full+json"], "Connection": ["keep-alive"], "Accept-Charset": ["utf-8"], "Content-Type": ["application/json"], "Content-Length": ["39"], "Authorization": ["token "]}, "method": "PATCH", "uri": "https://api.github.com/organizations/1782156/team/5678343"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA6VV227iMBD9FeRnICThGqladUV324cuL+ytL5GTDGBwYq/tQFPEv+/kQmXYqlCtxIM9mTm2z5w57ElGUyABSYCDgQ6u24QlJBgMR2O/77dJJhIIywiZh5vddHb7WT+vH/u3P/58v8dczfPlWXkCOlZMGiYyEmQ5520iFdvSuMBEDbECg4W54rhdGSN14DhUsu6SmVUedWOROkItacZeaImhHXc09tzB0DFAU6e5GCKsTMrDU5hTCO3Ue18WVa127FemkEag9BnChy/iNDj7ZnHAmymQQjMjFIP/x6/AEFSCSpnWFatEIq1ljCrIzJFlZJYaSEKKEeL1PK/T8zpuf+4OAtcNvMlTSbtM3snxe2XOkZlY5CW42zwobPa9NrH7Q4I94WLJymu98o0opWaaztkqepzeFbPNpHjyvuT0l1wlX/k2Wt/5s+nD87f575srpGH19Uj2xS7aWjgyClsk73KD7NK6BE9dCbH5WGlVUfKidX6FLOxT6xKrM5eGxy5+Q58yjziLw2snwEY7LbVFT7fUUHXeiCqom9nONahYZAZpr8Y8P472p+1NH5934hzkXuxaEoTk0IpyxpOWFguzQ8V3MbWxrUZwXVlgDCElzUqXOYaZwHCE6sQYrriIK0vB3SNNmBZZu/XzAT9AShnaUW1WZseMAXwJ3rY+po4zHW5BsQUDVPaCcg0oA6pDexhCqcQaYqNJYFTeJLzaQfHP54bOWpHBGCe6bs2S6RIDR20hOBc7NCprxzJ8EH573wHtYTyzBhetYdDxRvNeP/AGgT98wxrccac36nju3J0EPv4qazCFLP8tZpY/k8PhL7cDkoxGBgAA", "string": ""}, "headers": {"Server": ["GitHub.com"], "Date": ["Mon, 14 Feb 2022 15:11:30 GMT"], "Content-Type": ["application/json; charset=utf-8"], "Transfer-Encoding": ["chunked"], "Cache-Control": ["private, max-age=60, s-maxage=60"], "Vary": ["Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With"], "ETag": ["W/\"31b641d46bc227332df0345fd0caa5a84895cbfde9927365b9bb2bce1492edb7\""], "X-OAuth-Scopes": ["admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages"], "X-Accepted-OAuth-Scopes": ["admin:org, repo"], "github-authentication-token-expiration": ["2022-02-28 23:43:49 UTC"], "X-GitHub-Media-Type": ["github.v3; param=full; format=json"], "X-RateLimit-Limit": ["5000"], "X-RateLimit-Remaining": ["4967"], "X-RateLimit-Reset": ["1644852367"], "X-RateLimit-Used": ["33"], "X-RateLimit-Resource": ["core"], "Access-Control-Expose-Headers": ["ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset"], "Access-Control-Allow-Origin": ["*"], "Strict-Transport-Security": ["max-age=31536000; includeSubdomains; preload"], "X-Frame-Options": ["deny"], "X-Content-Type-Options": ["nosniff"], "X-XSS-Protection": ["0"], "Referrer-Policy": ["origin-when-cross-origin, strict-origin-when-cross-origin"], "Content-Security-Policy": ["default-src 'none'"], "Content-Encoding": ["gzip"], "X-GitHub-Request-Id": ["C494:0E6D:4039142:A7BA330:620A7121"]}, "status": {"code": 200, "message": "OK"}, "url": "https://api.github.com/organizations/1782156/team/5678343"}, "recorded_at": "2022-02-14T15:11:30"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["github3.py/3.0.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["application/vnd.github.v3.full+json"], "Connection": ["keep-alive"], "Accept-Charset": ["utf-8"], "Content-Type": ["application/json"], "Content-Length": ["0"], "Authorization": ["token "]}, "method": "DELETE", "uri": "https://api.github.com/organizations/1782156/team/5678343"}, "response": {"body": {"encoding": null, "string": ""}, "headers": {"Server": ["GitHub.com"], "Date": ["Mon, 14 Feb 2022 15:11:30 GMT"], "X-OAuth-Scopes": ["admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages"], "X-Accepted-OAuth-Scopes": ["admin:org, repo"], "github-authentication-token-expiration": ["2022-02-28 23:43:49 UTC"], "X-GitHub-Media-Type": ["github.v3; param=full; format=json"], "X-RateLimit-Limit": ["5000"], "X-RateLimit-Remaining": ["4966"], "X-RateLimit-Reset": ["1644852367"], "X-RateLimit-Used": ["34"], "X-RateLimit-Resource": ["core"], "Access-Control-Expose-Headers": ["ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset"], "Access-Control-Allow-Origin": ["*"], "Strict-Transport-Security": ["max-age=31536000; includeSubdomains; preload"], "X-Frame-Options": ["deny"], "X-Content-Type-Options": ["nosniff"], "X-XSS-Protection": ["0"], "Referrer-Policy": ["origin-when-cross-origin, strict-origin-when-cross-origin"], "Content-Security-Policy": ["default-src 'none'"], "Vary": ["Accept-Encoding, Accept, X-Requested-With"], "X-GitHub-Request-Id": ["C494:0E6D:403916A:A7BA3A5:620A7122"]}, "status": {"code": 204, "message": "No Content"}, "url": "https://api.github.com/organizations/1782156/team/5678343"}, "recorded_at": "2022-02-14T15:11:30"}], "recorded_with": "betamax/0.8.1"} +{"http_interactions": [{"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["github3.py/3.1.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["application/vnd.github.v3.full+json"], "Connection": ["keep-alive"], "Accept-Charset": ["utf-8"], "Content-Type": ["application/json"], "Authorization": ["token "]}, "method": "GET", "uri": "https://api.github.com/orgs/github3py"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA51VTXPaMBD9K4zPYBsTIHgm0x6StjmkuWSmbS6etb02CrKkSjIuzeS/d2WbxCRkJpThYFb79uO9J/PocVky4cVeyey6Tmdq5409lnvxdHkeTeeLsSdkjomLeDeXV7vbzWp3H32p4ada51/5Nn24mt1eXv/5fvfrgpC15pS4tlaZOAhAMb+r62eyCqQuTTDso1FJk5yACVoE9cEtCnsatIMQdi3l5jRoi3C8GFPjadAOQtgKqxT1aeAe8xh0D09URtUpZ1nyP9UOocOisAUL+rUQbdD0AtYGdSaFJdpbLeugN8in7cUZzZWjyTRTlklnpm+yGSmUiuMorRnPR0YWtgGNPqUKqPDFcH7rOCqpQOwGYSYpnJI7vVjUnI/JqBn05W8gZ0aK8ejHNSVhBYxc12XZhlmLtAvN2zXq4swkW9SsYEhOLoAbJCOASciTINjftnKitHzAzBovtrruE1rHMSv17s1xT2jnyfj8WZySGVcjHHuF5Fw2JPvgFxO0Ep2tbcVfUT64K8NrkmkEi3kClviJwmk0CeeTaHkXnsXRPJ4t7omEWuUHOeeTcDmJpnfTVTyjb+hy7E454m8HK7uotMBpN0Z6Y9IvQ/PJRlDPt/F95GVLEmNDhENJ1edOS84hlRqItG7xlHFOaye9Ul6pfSgKH5yVuF8x4Zdy+7l0OjpztXYqoOa2G6dnH3VFt6kzWKOZRcrb34MMRNLR9AJhSN17qW0jkwIymojOf9dMY0VOTlBAygeO2JeDVrZ82L6t7kzSsyikeGeAoS3c6MM5jsx7wPAH8hldQrI2P77osQYkzLOlh+eF1JtDgT/Qvt9OvVe0V2G/1UGe4kBvh8f9G6DQ6Cg0CjJyzmq5mC+is9WK7tGhGachfegykYtIE0M60Dr0z9Q/hU9P/wAGD7D/xwYAAA==", "string": ""}, "headers": {"Server": ["GitHub.com"], "Date": ["Mon, 21 Feb 2022 20:23:50 GMT"], "Content-Type": ["application/json; charset=utf-8"], "Transfer-Encoding": ["chunked"], "Cache-Control": ["private, max-age=60, s-maxage=60"], "Vary": ["Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With"], "ETag": ["W/\"33bb9e34d4beb7fd3846af5913e6ff19663fce73ce0ff0f3bb03a1971e1be933\""], "Last-Modified": ["Sat, 21 Jul 2018 19:39:30 GMT"], "X-OAuth-Scopes": ["admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages"], "X-Accepted-OAuth-Scopes": ["admin:org, read:org, repo, user, write:org"], "github-authentication-token-expiration": ["2022-02-28 23:43:49 UTC"], "X-GitHub-Media-Type": ["github.v3; param=full; format=json"], "X-RateLimit-Limit": ["5000"], "X-RateLimit-Remaining": ["4981"], "X-RateLimit-Reset": ["1645477925"], "X-RateLimit-Used": ["19"], "X-RateLimit-Resource": ["core"], "Access-Control-Expose-Headers": ["ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset"], "Access-Control-Allow-Origin": ["*"], "Strict-Transport-Security": ["max-age=31536000; includeSubdomains; preload"], "X-Frame-Options": ["deny"], "X-Content-Type-Options": ["nosniff"], "X-XSS-Protection": ["0"], "Referrer-Policy": ["origin-when-cross-origin, strict-origin-when-cross-origin"], "Content-Security-Policy": ["default-src 'none'"], "Content-Encoding": ["gzip"], "X-GitHub-Request-Id": ["E76A:02B3:2C8201:5E2F72:6213F4D6"]}, "status": {"code": 200, "message": "OK"}, "url": "https://api.github.com/orgs/github3py"}, "recorded_at": "2022-02-21T20:23:50"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"edit-me\", \"repo_names\": [], \"maintainers\": [], \"permission\": \"pull\", \"privacy\": \"closed\"}"}, "headers": {"User-Agent": ["github3.py/3.1.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["application/vnd.github.v3.full+json"], "Connection": ["keep-alive"], "Accept-Charset": ["utf-8"], "Content-Type": ["application/json"], "Content-Length": ["99"], "Authorization": ["token "]}, "method": "POST", "uri": "https://api.github.com/orgs/github3py/teams"}, "response": {"body": {"encoding": "utf-8", "string": "{\"name\":\"edit-me\",\"id\":5710367,\"node_id\":\"T_kwDOABsxjM4AVyIf\",\"slug\":\"edit-me\",\"description\":null,\"privacy\":\"closed\",\"url\":\"https://api.github.com/organizations/1782156/team/5710367\",\"html_url\":\"https://github.com/orgs/github3py/teams/edit-me\",\"members_url\":\"https://api.github.com/organizations/1782156/team/5710367/members{/member}\",\"repositories_url\":\"https://api.github.com/organizations/1782156/team/5710367/repos\",\"permission\":\"pull\",\"parent\":null,\"created_at\":\"2022-02-21T20:23:50Z\",\"updated_at\":\"2022-02-21T20:23:50Z\",\"members_count\":1,\"repos_count\":0,\"organization\":{\"login\":\"github3py\",\"id\":1782156,\"node_id\":\"MDEyOk9yZ2FuaXphdGlvbjE3ODIxNTY=\",\"url\":\"https://api.github.com/orgs/github3py\",\"repos_url\":\"https://api.github.com/orgs/github3py/repos\",\"events_url\":\"https://api.github.com/orgs/github3py/events\",\"hooks_url\":\"https://api.github.com/orgs/github3py/hooks\",\"issues_url\":\"https://api.github.com/orgs/github3py/issues\",\"members_url\":\"https://api.github.com/orgs/github3py/members{/member}\",\"public_members_url\":\"https://api.github.com/orgs/github3py/public_members{/member}\",\"avatar_url\":\"https://avatars.githubusercontent.com/u/1782156?v=4\",\"description\":\"How people build software.\",\"name\":\"github3.py\",\"company\":\"github3.io\",\"blog\":\"\",\"location\":\"Madison, WI\",\"email\":null,\"twitter_username\":null,\"is_verified\":false,\"has_organization_projects\":true,\"has_repository_projects\":true,\"public_repos\":8,\"public_gists\":0,\"followers\":0,\"following\":0,\"html_url\":\"https://github.com/github3py\",\"created_at\":\"2012-05-27T04:25:36Z\",\"updated_at\":\"2018-07-21T19:39:30Z\",\"type\":\"Organization\"}}"}, "headers": {"Server": ["GitHub.com"], "Date": ["Mon, 21 Feb 2022 20:23:51 GMT"], "Content-Type": ["application/json; charset=utf-8"], "Content-Length": ["1600"], "Cache-Control": ["private, max-age=60, s-maxage=60"], "Vary": ["Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With"], "ETag": ["\"756554a05cf783959351596342882be560c715c74a81ba6b71100fafa5350aed\""], "X-OAuth-Scopes": ["admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages"], "X-Accepted-OAuth-Scopes": ["admin:org, repo"], "github-authentication-token-expiration": ["2022-02-28 23:43:49 UTC"], "Location": ["https://api.github.com/organizations/1782156/team/5710367"], "X-GitHub-Media-Type": ["github.v3; param=full; format=json"], "X-RateLimit-Limit": ["5000"], "X-RateLimit-Remaining": ["4980"], "X-RateLimit-Reset": ["1645477925"], "X-RateLimit-Used": ["20"], "X-RateLimit-Resource": ["core"], "Access-Control-Expose-Headers": ["ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset"], "Access-Control-Allow-Origin": ["*"], "Strict-Transport-Security": ["max-age=31536000; includeSubdomains; preload"], "X-Frame-Options": ["deny"], "X-Content-Type-Options": ["nosniff"], "X-XSS-Protection": ["0"], "Referrer-Policy": ["origin-when-cross-origin, strict-origin-when-cross-origin"], "Content-Security-Policy": ["default-src 'none'"], "X-GitHub-Request-Id": ["E76A:02B3:2C8207:5E2F7C:6213F4D6"]}, "status": {"code": 201, "message": "Created"}, "url": "https://api.github.com/orgs/github3py/teams"}, "recorded_at": "2022-02-21T20:23:51"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"parent\", \"repo_names\": [], \"maintainers\": [], \"permission\": \"pull\", \"privacy\": \"closed\"}"}, "headers": {"User-Agent": ["github3.py/3.1.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["application/vnd.github.v3.full+json"], "Connection": ["keep-alive"], "Accept-Charset": ["utf-8"], "Content-Type": ["application/json"], "Content-Length": ["98"], "Authorization": ["token "]}, "method": "POST", "uri": "https://api.github.com/orgs/github3py/teams"}, "response": {"body": {"encoding": "utf-8", "string": "{\"name\":\"parent\",\"id\":5710368,\"node_id\":\"T_kwDOABsxjM4AVyIg\",\"slug\":\"parent\",\"description\":null,\"privacy\":\"closed\",\"url\":\"https://api.github.com/organizations/1782156/team/5710368\",\"html_url\":\"https://github.com/orgs/github3py/teams/parent\",\"members_url\":\"https://api.github.com/organizations/1782156/team/5710368/members{/member}\",\"repositories_url\":\"https://api.github.com/organizations/1782156/team/5710368/repos\",\"permission\":\"pull\",\"parent\":null,\"created_at\":\"2022-02-21T20:23:52Z\",\"updated_at\":\"2022-02-21T20:23:52Z\",\"members_count\":1,\"repos_count\":0,\"organization\":{\"login\":\"github3py\",\"id\":1782156,\"node_id\":\"MDEyOk9yZ2FuaXphdGlvbjE3ODIxNTY=\",\"url\":\"https://api.github.com/orgs/github3py\",\"repos_url\":\"https://api.github.com/orgs/github3py/repos\",\"events_url\":\"https://api.github.com/orgs/github3py/events\",\"hooks_url\":\"https://api.github.com/orgs/github3py/hooks\",\"issues_url\":\"https://api.github.com/orgs/github3py/issues\",\"members_url\":\"https://api.github.com/orgs/github3py/members{/member}\",\"public_members_url\":\"https://api.github.com/orgs/github3py/public_members{/member}\",\"avatar_url\":\"https://avatars.githubusercontent.com/u/1782156?v=4\",\"description\":\"How people build software.\",\"name\":\"github3.py\",\"company\":\"github3.io\",\"blog\":\"\",\"location\":\"Madison, WI\",\"email\":null,\"twitter_username\":null,\"is_verified\":false,\"has_organization_projects\":true,\"has_repository_projects\":true,\"public_repos\":8,\"public_gists\":0,\"followers\":0,\"following\":0,\"html_url\":\"https://github.com/github3py\",\"created_at\":\"2012-05-27T04:25:36Z\",\"updated_at\":\"2018-07-21T19:39:30Z\",\"type\":\"Organization\"}}"}, "headers": {"Server": ["GitHub.com"], "Date": ["Mon, 21 Feb 2022 20:23:52 GMT"], "Content-Type": ["application/json; charset=utf-8"], "Content-Length": ["1597"], "Cache-Control": ["private, max-age=60, s-maxage=60"], "Vary": ["Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With"], "ETag": ["\"2311434ad8050218864aa08b5c875f4635d5c5f36ff366b0ba8423b28ae005d0\""], "X-OAuth-Scopes": ["admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages"], "X-Accepted-OAuth-Scopes": ["admin:org, repo"], "github-authentication-token-expiration": ["2022-02-28 23:43:49 UTC"], "Location": ["https://api.github.com/organizations/1782156/team/5710368"], "X-GitHub-Media-Type": ["github.v3; param=full; format=json"], "X-RateLimit-Limit": ["5000"], "X-RateLimit-Remaining": ["4979"], "X-RateLimit-Reset": ["1645477925"], "X-RateLimit-Used": ["21"], "X-RateLimit-Resource": ["core"], "Access-Control-Expose-Headers": ["ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset"], "Access-Control-Allow-Origin": ["*"], "Strict-Transport-Security": ["max-age=31536000; includeSubdomains; preload"], "X-Frame-Options": ["deny"], "X-Content-Type-Options": ["nosniff"], "X-XSS-Protection": ["0"], "Referrer-Policy": ["origin-when-cross-origin, strict-origin-when-cross-origin"], "Content-Security-Policy": ["default-src 'none'"], "X-GitHub-Request-Id": ["E76A:02B3:2C823F:5E300C:6213F4D7"]}, "status": {"code": 201, "message": "Created"}, "url": "https://api.github.com/orgs/github3py/teams"}, "recorded_at": "2022-02-21T20:23:52"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"name\": \"delete-me\", \"parent_team_id\": 5710368}"}, "headers": {"User-Agent": ["github3.py/3.1.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["application/vnd.github.v3.full+json"], "Connection": ["keep-alive"], "Accept-Charset": ["utf-8"], "Content-Type": ["application/json"], "Content-Length": ["48"], "Authorization": ["token "]}, "method": "PATCH", "uri": "https://api.github.com/organizations/1782156/team/5710367"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA71V224aMRD9FeRnYC+EQCxFVSrSlgfKC+olLyuza8CJd23ZXsg24t873jXU0JSE3iQe7NmZYTxzzpknVJCcIowyyqmhHTi3EcsQ7g+isHc5aKNCZDSxFjRLHjaj6c1b/Xg/ubj5VI0X4Kt5uTwKz6hOFZOGiQLhouS8jaRia5JW4JhyoWkGgaXicF0ZIzUOAiJZd8nMqpx3U5EHQi1Jwb4Rm0MH0WAYR/3LwFCSB64wyLAyOU8O0xym0EFz78mqjtWB/8qc5nOq9FGGswsJXJ4nd9hCZYpKoZkRitE/z18ng6SSqpxpXXcVSWirtRFFC4Pw026MzuDPcHhyhssfM9zH/o8BDn9vgPsa/870hv94esPg19PbtlGqKDE0SwiMEMVhHHfCuBNHszjEcQ/3wzvLE5md8omtz64ZqSgtGiKHwMTdwzbyCWXhwsWSWRztCQJZLMkd1XzITEa31fThqrqL35Xki1xl7/l6fn/bm47Gjx9nX69tjS9w2SMieNcteZF2Pnl3TaRrQPt5oU2IBZsQD+eF1hG2L1qXr+CxX3AT4k3mjA49B0lZzjlLk9eC3i/lMNRXKbImhqjjQdRG7cS41FSlojDQ9lqXy50Wv1lfX8DzDpQCfRCblqRCctqal4xnLS0WZgMS1QVXt2cc4LqyAhuklKSwa2FnZgLMc0An2ODERVrvALhNSMa0KNqtz2P4QHPCYH8028VsmDEUXgLVNn/T2JlO1lSxBYOFgxeEawowIDrxyZBIJe5pajTCRpXOYa/f1U+fXTsbRGLQVmdYMm1zANUWgnOxgc3i3VgBD4Jvp1eWT8YjaYhAGvqdeDALL3Dcx73LZ6QhGnbCgZWP6Ar34FfLh6mkXe9Tb6Gi7fY7idVx8PcHAAA=", "string": ""}, "headers": {"Server": ["GitHub.com"], "Date": ["Mon, 21 Feb 2022 20:23:52 GMT"], "Content-Type": ["application/json; charset=utf-8"], "Transfer-Encoding": ["chunked"], "Cache-Control": ["private, max-age=60, s-maxage=60"], "Vary": ["Accept, Authorization, Cookie, X-GitHub-OTP", "Accept-Encoding, Accept, X-Requested-With"], "ETag": ["W/\"5c1dc40a02ef7cd1a02c9b3165c98ca40001b63d3046dad6ba96ce1e37b2ede2\""], "X-OAuth-Scopes": ["admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages"], "X-Accepted-OAuth-Scopes": ["admin:org, repo"], "github-authentication-token-expiration": ["2022-02-28 23:43:49 UTC"], "X-GitHub-Media-Type": ["github.v3; param=full; format=json"], "X-RateLimit-Limit": ["5000"], "X-RateLimit-Remaining": ["4978"], "X-RateLimit-Reset": ["1645477925"], "X-RateLimit-Used": ["22"], "X-RateLimit-Resource": ["core"], "Access-Control-Expose-Headers": ["ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset"], "Access-Control-Allow-Origin": ["*"], "Strict-Transport-Security": ["max-age=31536000; includeSubdomains; preload"], "X-Frame-Options": ["deny"], "X-Content-Type-Options": ["nosniff"], "X-XSS-Protection": ["0"], "Referrer-Policy": ["origin-when-cross-origin, strict-origin-when-cross-origin"], "Content-Security-Policy": ["default-src 'none'"], "Content-Encoding": ["gzip"], "X-GitHub-Request-Id": ["E76A:02B3:2C8263:5E305E:6213F4D8"]}, "status": {"code": 200, "message": "OK"}, "url": "https://api.github.com/organizations/1782156/team/5710367"}, "recorded_at": "2022-02-21T20:23:52"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["github3.py/3.1.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["application/vnd.github.v3.full+json"], "Connection": ["keep-alive"], "Accept-Charset": ["utf-8"], "Content-Type": ["application/json"], "Content-Length": ["0"], "Authorization": ["token "]}, "method": "DELETE", "uri": "https://api.github.com/organizations/1782156/team/5710367"}, "response": {"body": {"encoding": null, "string": ""}, "headers": {"Server": ["GitHub.com"], "Date": ["Mon, 21 Feb 2022 20:23:53 GMT"], "X-OAuth-Scopes": ["admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages"], "X-Accepted-OAuth-Scopes": ["admin:org, repo"], "github-authentication-token-expiration": ["2022-02-28 23:43:49 UTC"], "X-GitHub-Media-Type": ["github.v3; param=full; format=json"], "X-RateLimit-Limit": ["5000"], "X-RateLimit-Remaining": ["4977"], "X-RateLimit-Reset": ["1645477925"], "X-RateLimit-Used": ["23"], "X-RateLimit-Resource": ["core"], "Access-Control-Expose-Headers": ["ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset"], "Access-Control-Allow-Origin": ["*"], "Strict-Transport-Security": ["max-age=31536000; includeSubdomains; preload"], "X-Frame-Options": ["deny"], "X-Content-Type-Options": ["nosniff"], "X-XSS-Protection": ["0"], "Referrer-Policy": ["origin-when-cross-origin, strict-origin-when-cross-origin"], "Content-Security-Policy": ["default-src 'none'"], "Vary": ["Accept-Encoding, Accept, X-Requested-With"], "X-GitHub-Request-Id": ["E76A:02B3:2C8282:5E309B:6213F4D8"]}, "status": {"code": 204, "message": "No Content"}, "url": "https://api.github.com/organizations/1782156/team/5710367"}, "recorded_at": "2022-02-21T20:23:53"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": ["github3.py/3.1.0"], "Accept-Encoding": ["gzip, deflate"], "Accept": ["application/vnd.github.v3.full+json"], "Connection": ["keep-alive"], "Accept-Charset": ["utf-8"], "Content-Type": ["application/json"], "Content-Length": ["0"], "Authorization": ["token "]}, "method": "DELETE", "uri": "https://api.github.com/organizations/1782156/team/5710368"}, "response": {"body": {"encoding": null, "string": ""}, "headers": {"Server": ["GitHub.com"], "Date": ["Mon, 21 Feb 2022 20:23:53 GMT"], "X-OAuth-Scopes": ["admin:enterprise, admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete:packages, delete_repo, gist, notifications, repo, user, workflow, write:discussion, write:packages"], "X-Accepted-OAuth-Scopes": ["admin:org, repo"], "github-authentication-token-expiration": ["2022-02-28 23:43:49 UTC"], "X-GitHub-Media-Type": ["github.v3; param=full; format=json"], "X-RateLimit-Limit": ["5000"], "X-RateLimit-Remaining": ["4976"], "X-RateLimit-Reset": ["1645477925"], "X-RateLimit-Used": ["24"], "X-RateLimit-Resource": ["core"], "Access-Control-Expose-Headers": ["ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset"], "Access-Control-Allow-Origin": ["*"], "Strict-Transport-Security": ["max-age=31536000; includeSubdomains; preload"], "X-Frame-Options": ["deny"], "X-Content-Type-Options": ["nosniff"], "X-XSS-Protection": ["0"], "Referrer-Policy": ["origin-when-cross-origin, strict-origin-when-cross-origin"], "Content-Security-Policy": ["default-src 'none'"], "Vary": ["Accept-Encoding, Accept, X-Requested-With"], "X-GitHub-Request-Id": ["E76A:02B3:2C8292:5E30CB:6213F4D9"]}, "status": {"code": 204, "message": "No Content"}, "url": "https://api.github.com/organizations/1782156/team/5710368"}, "recorded_at": "2022-02-21T20:23:53"}], "recorded_with": "betamax/0.8.1"} diff --git a/tests/integration/test_orgs_team.py b/tests/integration/test_orgs_team.py index db2efd7c..abc45eca 100644 --- a/tests/integration/test_orgs_team.py +++ b/tests/integration/test_orgs_team.py @@ -48,14 +48,16 @@ def test_edit(self): with self.recorder.use_cassette(cassette_name): o = self.get_organization() # Create a new team to play with - t = o.create_team("edit-me") + t = o.create_team("edit-me", privacy="closed") + p = o.create_team("parent", privacy="closed") assert isinstance(t, github3.orgs.Team) # Edit the new team - assert t.edit("delete-me") is True + assert t.edit("delete-me", parent_team_id=p.id) is True # Assert that the name has changed assert t.name == "delete-me" # Get rid of it, we don't need it. assert t.delete() is True + assert p.delete() is True def test_has_repository(self): """Show that a user can check of a team has access to a repository.""" diff --git a/tests/unit/test_orgs_team.py b/tests/unit/test_orgs_team.py index 8cbc7f36..dba0e549 100644 --- a/tests/unit/test_orgs_team.py +++ b/tests/unit/test_orgs_team.py @@ -33,10 +33,15 @@ def test_delete(self): def test_edit(self): """Show that a user can edit a team.""" - self.instance.edit("name", "admin") + self.instance.edit("name", "admin", 1234) self.patch_called_with( - url_for(), data={"name": "name", "permission": "admin"} + url_for(), + data={ + "name": "name", + "permission": "admin", + "parent_team_id": 1234, + }, ) def test_has_repository(self):