8000 Add integration test for GitHub#activate_membership · cs-shadow/github3.py@b6e6f51 · GitHub
[go: up one dir, main page]

Skip to content

Commit b6e6f51

Browse files
committed
Add integration test for GitHub#activate_membership
Per @jacquerie's request, I've added an integration test for the new activate_membership method. This should help us ensure that this behaviour continues to work as expected.
1 parent 3b15ba0 commit b6e6f51

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"http_interactions": [{"request": {"body": {"encoding": "utf-8", "string": "{\"state\": \"active\"}"}, "headers": {"User-Agent": ["github3.py/1.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": ["19"], "Authorization": ["Basic <BASIC_AUTH>"]}, "method": "PATCH", "uri": "https://api.github.com/user/memberships/orgs/sv24-archive"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA52VXW+bMBSG/0rkm910dUNIq0aqpkrrpl0sVaRuqnaDjHHArbGRP6gSlP++Y2AtBC2rd4EAi+c9x8fnPTTIaYFWqLC2MiuMScXPc24Ll55TVWKlc4NNHcUfiaYFrxkuWZkybQpeGZwXC8uMRWfIWGIZyBBq4SNY0Er49+5reAchIvmeWK5kEhYSaGeYRqsGCZVzCbJvgXmGVtFiGS+WF2dIqowlfgV9/7y5/Pm4FvTp2379sIHr9gZ0SE0s0cfx20UT9fv2saiSlknblsDhXv9TfRODRq57lTaQT+5UAb3asFCFLcVR/EG53/a1VUKoF2CPkx2fz0gev0KQVffMZR4uAFCDlS0YVArSP/hNc2ODUmmBBvsbnIiXgBbRmmUh6fQIJPMiIY8Ga1apVsulhmpe+W4KSmsEgtCwLYOEvDGA9wkFcS0AIKuhv4LIjmhwpXlN6M6XQTPKwG5ZEq52hIKY3VXesT+81aDC3LKEZKW325YIww7jYg3dOJwPgHpfzC+v4+XV1XLsybvd/fP17lf0xZHHqsi+ijp9uovuHzbz9Z7OAT1ppcksel/9J1jbRe89gynd1RpiF0o9/+MEp3QL+SIZ41gw3VGA91P4tJmm0Xus6ae476HKpYLT5D8Fx/RQ99SovfjrqP3TN/2szdirzaE1b7tf0ExtZ4bnJam5diaKP5iZkyXh0sLFsll7vNwqzZlBh8NvGoNG5eIGAAA=", "string": ""}, "headers": {"Server": ["GitHub.com"], "Date": ["Sun, 29 Jul 2018 17:00:05 GMT"], "Content-Type": ["application/json; charset=utf-8"], "Transfer-Encoding": ["chunked"], "Status": ["200 OK"], "X-RateLimit-Limit": ["5000"], "X-RateLimit-Remaining": ["4999"], "X-RateLimit-Reset": ["1532887205"], "Cache-Control": ["private, max-age=60, s-maxage=60"], "Vary": ["Accept, Authorization, Cookie, X-GitHub-OTP"], "ETag": ["W/\"926acdf614b4e3943235c332dab504d4\""], "X-GitHub-Media-Type": ["github.v3; param=full; format=json"], "Access-Control-Expose-Headers": ["ETag, Link, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval"], "Access-Control-Allow-Origin": ["*"], "Strict-Transport-Security": ["max-age=31536000; includeSubdomains; preload"], "X-Frame-Options": ["deny"], "X-Content-Type-Options": ["nosniff"], "X-XSS-Protection": ["1; mode=block"], "Referrer-Policy": ["origin-when-cross-origin, strict-origin-when-cross-origin"], "Content-Security-Policy": ["default-src 'none'"], "X-Runtime-rack": ["0.128841"], "Content-Encoding": ["gzip"], "X-GitHub-Request-Id": ["89AE:3F4B:CCC5C6:2079DFF:5B5DF295"]}, "status": {"code": 200, "message": "OK"}, "url": "https://api.github.com/user/memberships/orgs/sv24-archive"}, "recorded_at": "2018-07-29T17:00:05"}], "recorded_with": "betamax/0.8.1"}

tests/integration/test_github.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,15 @@ class TestGitHub(IntegrationHelper):
2727

2828
match_on = ['method', 'uri', 'gh3-headers']
2929

30+
def test_activate_membership(self):
31+
"""Validate the ability to activate membership."""
32+
self.basic_login()
33+
cassette_name = self.cassette_name('activate_membership')
34+
with self.recorder.use_cassette(cassette_name):
35+
membership = self.gh.activate_membership('sv24-archive')
36+
37+
assert isinstance(membership, github3.orgs.Membership)
38+
3039
def test_authorize(self):
3140
"""Test the ability to create an authorization."""
3241
from ..conftest import credentials

0 commit comments

Comments
 (0)
0