mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 10:51:14 +00:00
NamedUser.get_organization_membership() was calling the API method for fetching the currently authenticated user only, which is incorrect. The method was not tested directly, so add tests. Furthermore, Membership had some errors which had slipped through review, so correct them. Sadly, this is an API break, since passing the organization as an int made no sense in this case. Fixes #1276
23 lines
4.0 KiB
Plaintext
23 lines
4.0 KiB
Plaintext
https
|
|
GET
|
|
api.github.com
|
|
None
|
|
/users/jacquev6/orgs
|
|
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
|
|
None
|
|
200
|
|
[('status', '200 OK'), ('x-ratelimit-remaining', '4949'), ('content-length', '262'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"82deae94305d8c551e4874e06f6efd48"'), ('date', 'Tue, 29 Oct 2019 06:37:43 GMT'), ('content-type', 'application/json; charset=utf-8')]
|
|
[{"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","url":"https://api.github.com/orgs/BeaverSoftware","login":"BeaverSoftware","id":1424031}]
|
|
|
|
https
|
|
GET
|
|
api.github.com
|
|
None
|
|
/orgs/BeaverSoftware/memberships/jacquev6
|
|
{'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
|
|
None
|
|
200
|
|
[('vary', 'Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding'), ('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, read:packages, repo, user, workflow, write:discussion, write:packages'), ('x-xss-protection', '1; mode=block'), ('x-content-type-options', 'nosniff'), ('x-accepted-oauth-scopes', 'admin:org, read:org, repo, user, write:org'), ('etag', 'W/"a48fb9108de1ab30ca11a7d7b676b7d0"'), ('cache-control', 'private, max-age=60, s-maxage=60'), ('referrer-policy', 'origin-when-cross-origin, strict-origin-when-cross-origin'), ('status', '200 OK'), ('x-ratelimit-remaining', '4997'), ('x-github-media-type', 'github.v3; format=json'), ('access-control-expose-headers', 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type'), ('transfer-encoding', 'chunked'), ('x-github-request-id', '965A:5675:180111:1B9D26:5DB7F14D'), ('date', 'Tue, 29 Oct 2019 07:59:15 GMT'), ('access-control-allow-origin', '*'), ('content-security-policy', "default-src 'none'"), ('content-encoding', 'gzip'), ('strict-transport-security', 'max-age=31536000; includeSubdomains; preload'), ('server', 'GitHub.com'), ('x-ratelimit-limit', '5000'), ('x-frame-options', 'deny'), ('content-type', 'application/json; charset=utf-8'), ('x-ratelimit-reset', '1572339549')]
|
|
{"url":"https://api.github.com/orgs/BeaverSoftware/memberships/jacquev6","state":"active","role":"member","user":{"following_url":"https://api.github.com/users/jacquev6/following{/other_user}","events_url":"https://api.github.com/users/jacquev6/events{/privacy}","avatar_url":"https://avatars0.githubusercontent.com/u/15225059?v=4","url":"https://api.github.com/users/jacquev6","gists_url":"https://api.github.com/users/jacquev6/gists{/gist_id}","html_url":"https://github.com/jacquev6","subscriptions_url":"https://api.github.com/users/jacquev6/subscriptions","node_id":"MDQ6VXNlcjE1MjI1MDU5","repos_url":"https://api.github.com/users/jacquev6/repos","received_events_url":"https://api.github.com/users/jacquev6/received_events","gravatar_id":"","starred_url":"https://api.github.com/users/jacquev6/starred{/owner}{/repo}","site_admin":false,"login":"jacquev6","type":"User","id":15225059,"followers_url":"https://api.github.com/users/jacquev6/followers","organizations_url":"https://api.github.com/users/jacquev6/orgs"},"organization":{"issues_url":"https://api.github.com/orgs/BeaverSoftware/issues","members_url":"https://api.github.com/orgs/BeaverSoftware/members{/member}","description":null,"public_members_url":"https://api.github.com/orgs/BeaverSoftware/public_members{/member}","url":"https://api.github.com/orgs/BeaverSoftware","events_url":"https://api.github.com/orgs/BeaverSoftware/events","avatar_url":"https://avatars0.githubusercontent.com/u/1553906?v=4","node_id":"MDEyOk9yZ2FuaXphdGlvbjE1NTM5MDY=","repos_url":"https://api.github.com/orgs/BeaverSoftware/repos","login":"BeaverSoftware","id":1553906,"hooks_url":"https://api.github.com/orgs/BeaverSoftware/hooks"},"organization_url":"https://api.github.com/orgs/BeaverSoftware"}
|
|
|