Skip to content
Snippets Groups Projects
Verified Commit ad6e4ed8 authored by Ian Stapleton Cordasco's avatar Ian Stapleton Cordasco
Browse files

Re-write and re-record Repository.subscription test

parent 05e33ea0
No related branches found
No related tags found
No related merge requests found
{"recorded_with": "betamax/0.8.0", "http_interactions": [{"response": {"body": {"string": "{\"message\":\"Bad credentials\",\"documentation_url\":\"https://developer.github.com/v3\"}", "encoding": "utf-8"}, "headers": {"X-RateLimit-Limit": "60", "X-RateLimit-Reset": "1496099157", "Content-Security-Policy": "default-src 'none'", "Content-Type": "application/json; charset=utf-8", "X-GitHub-Request-Id": "B964:29AF:3CF7F6D:4902157:592C9B48", "Date": "Mon, 29 May 2017 22:06:00 GMT", "Access-Control-Expose-Headers": "ETag, Link, 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": "*", "X-RateLimit-Remaining": "43", "Server": "GitHub.com", "X-GitHub-Media-Type": "github.drax-preview; format=json", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "Content-Length": "83", "X-Frame-Options": "deny", "Status": "401 Unauthorized", "X-XSS-Protection": "1; mode=block", "X-Content-Type-Options": "nosniff"}, "url": "https://api.github.com/repos/sigmavirus24/github3.py", "status": {"code": 401, "message": "Unauthorized"}}, "recorded_at": "2017-05-29T22:06:00", "request": {"uri": "https://api.github.com/repos/sigmavirus24/github3.py", "body": {"string": "", "encoding": "utf-8"}, "method": "GET", "headers": {"Connection": "keep-alive", "Accept-Charset": "utf-8", "Authorization": "token <AUTH_TOKEN>", "Content-Type": "application/json", "User-Agent": "github3.py/1.0.0a4", "Accept": "application/vnd.github.drax-preview+json", "Accept-Encoding": "gzip, deflate"}}}]}
\ No newline at end of file
{"http_interactions": [{"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": "github3.py/1.0.0a4", "Accept-Encoding": "gzip, deflate", "Accept": "application/vnd.github.drax-preview+json", "Connection": "keep-alive", "Accept-Charset": "utf-8", "Content-Type": "application/json", "Authorization": "token <AUTH_TOKEN>"}, "method": "GET", "uri": "https://api.github.com/repos/sigmavirus24/github3.py"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA62YwZLiNhCGX4XyNQzGeFh2XJXa5JTklD1sLrlQwhZYGdtyJBnCuObd87dkG5utwMwoFwqE+lOr1d3qVhuILEjiTbTcRNE8qFjJgyQ4CJM3u3hRn4N5sG+KYtv9ocWhZEehGr16DCez5KniKkjaoJAHUYExngoKLbN6XH6Ol/OAHZlhatuoAvNyY2qdhKEb1PHCYRvNVSorwyuzSGUZNqGT/nL88RG4g+ogxA0wcAWrRcdxwoDp8Eqj3JTFlQ5uaStyNXkvi0KeQLnW+t5C4SBJprQUUR0+SIFkG0qTcxgPW3olQwht3q+UlWpxgtpsRUYcjRNRPHu3Yp0c1CIHeG1DxWtpgc1Op0rURsjq/QpOpEGT6sAq8cI+RoO0BoRUe78qVgrS/AhffL+4E2vDWokjS89kGsVTLo4w9geRV/IgmnNNcfsHnIJMLwzfsqykONyzQvPXeWCXN5hkB+YIu7d6/zTOMz6cKhb8eja5rGaF2CmmzrO9VDOBmFV7lsJXZyfkkRncdfaLML82u9nPX387xlAQ854HTW5GrjX+JBin6hDpzpncRCA8AYBKz/zsxSH5NsRnF08pQp3tpGJG3ksatxWcgNpw/JN8yXBWeiluAQDlUvpZ0gIAElo3/E2ufXvjlqPDPn6qpty5lPeWqLmNdgToyjTyfMW5lwUHSBv2WRnhUKW5H7ZntKH7Zk+bHbxUJXlgdoXceXFwUYYW0oY6Z+4eMltf7YhKjAlU8b23qsQYoEZ5nrdVkyADEpegwdF76dkzwrazaMGqQ8MOftQBglOnq/rAXu4WMbdj50IBkio0JXaNf5K7cEhTVzsg3v1MesFcoLYguV3m3DHAqLCxJihLca8uuE3sEBO3/x+w5KfXaPp9v4y5ry4x2vCSk13S7+g+1u2yfq/neI2uHfByiZ4Rtj/UzOSUubBUzRT3UbpDhO2OodhaLBZtzpktq0uuPCPYEYBiKs1RNfro2fYMVD0lM7Za35OaGar3QrLMy7YDBEB3jD66OsL4/Gs0ol4KWsCYWIqCayMrvxx7oYzZlTRiL9K3dCy3w20Car9oUaV8zopiDq81IhXwY9TadIooOLmfhRwB28A7gOtUCg6X9rK64o7Rhq7TzHhdyLN3FhphKIgVR3eTbZlBV7JaRquHZfwQxd+ip2T9OVnHf2JOU2eTOZsHmvb0bblOVuvk8Ynm1I3ORxg7Jfr0LQIjSqIlTUFa7fwa3/BwgU88lnz3aDDqU+gpAoJa5xfBny5iyX+8qnRiaQEHvYqkt695vL7r7otC1VyWvEbtMXqfcXJxfV7A1BmaukymeiEkbUy8YGa0idZ43BlVGalsKpzHJv40D07MoCDGfT4e7KuToZOkpZneutgPEqMaalUxUiv5F0+NHo9d8s1o4kk8i0uTS5JUQg0jrl/sdFhtHpGhhVKye4yqkCCGRIuHpa5XljWvOp169aPlGvEmUl5pbL2l9hGbsE8z2EP3WvZ791PX2T9oC4PE8W3DS1/Rlrv2M7GajJaBNWmB3midDTO+Z01htq4fwHoZGplC1uS3XJWwGr21kDpd8+/sRz7d241SoPuOxZFE5Gmr/24YPNPeM/00948dwo6pwJn+ozjddFOZipsTmuneQnZL40KuM3q8fv0XoZu4P3UUAAA=", "string": ""}, "headers": {"Server": "GitHub.com", "Date": "Sat, 16 Dec 2017 19:18:59 GMT", "Content-Type": "application/json; charset=utf-8", "Transfer-Encoding": "chunked", "Status": "200 OK", "X-RateLimit-Limit": "5000", "X-RateLimit-Remaining": "4961", "X-RateLimit-Reset": "1513452093", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", "ETag": "W/\"8df1758e860f98de9c264c8cc883e8ee\"", "Last-Modified": "Sat, 09 Dec 2017 05:25:49 GMT", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user", "X-Accepted-OAuth-Scopes": "repo", "X-GitHub-Media-Type": "github.v3; param=drax-preview; 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": "*", "Content-Security-Policy": "default-src 'none'", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "deny", "X-XSS-Protection": "1; mode=block", "X-Runtime-rack": "0.057570", "Content-Encoding": "gzip", "X-GitHub-Request-Id": "9B88:17F6:17F8979:2B8CA5D:5A3571A3"}, "status": {"code": 200, "message": "OK"}, "url": "https://api.github.com/repos/sigmavirus24/github3.py"}, "recorded_at": "2017-12-16T19:18:59"}, {"request": {"body": {"encoding": "utf-8", "string": "{\"subcribed\": true}"}, "headers": {"User-Agent": "github3.py/1.0.0a4", "Accept-Encoding": "gzip, deflate", "Accept": "application/vnd.github.v3.full+json", "Connection": "keep-alive", "Accept-Charset": "utf-8", "Content-Type": "application/json", "Authorization": "token <AUTH_TOKEN>", "Content-Length": "19"}, "method": "PUT", "uri": "https://api.github.com/repos/sigmavirus24/github3.py/subscription"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA52OSw6DMAxE7+I1kIZ+yTlYdYMCpGApkMh2KqGqd29Qe4Iun95oZl7AqeeBsHcjGKHkCsBpDbTjw3rOTM5yWMGsyfsChozixs4KGKgP+lrqutSXVjdG38y5uUMBiXyWs0hko5SNWE0oc+qrISyKXAysGKfFPpES1yf1tccqbup3JwrmyX07h1ECbd3/pfD+ADeEf+jnAAAA", "string": ""}, "headers": {"Server": "GitHub.com", "Date": "Sat, 16 Dec 2017 19:18:59 GMT", "Content-Type": "application/json; charset=utf-8", "Transfer-Encoding": "chunked", "Status": "200 OK", "X-RateLimit-Limit": "5000", "X-RateLimit-Remaining": "4960", "X-RateLimit-Reset": "1513452093", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", "ETag": "W/\"79a1be5aa0a5301a4089e12b59ff9399\"", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user", "X-Accepted-OAuth-Scopes": "notifications, repo", "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": "*", "Content-Security-Policy": "default-src 'none'", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "deny", "X-XSS-Protection": "1; mode=block", "X-Runtime-rack": "0.027112", "Content-Encoding": "gzip", "X-GitHub-Request-Id": "9B88:17F6:17F898E:2B8CA84:5A3571A3"}, "status": {"code": 200, "message": "OK"}, "url": "https://api.github.com/repos/sigmavirus24/github3.py/subscription"}, "recorded_at": "2017-12-16T19:18:59"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": "github3.py/1.0.0a4", "Accept-Encoding": "gzip, deflate", "Accept": "application/vnd.github.v3.full+json", "Connection": "keep-alive", "Accept-Charset": "utf-8", "Content-Type": "application/json", "Authorization": "token <AUTH_TOKEN>"}, "method": "GET", "uri": "https://api.github.com/repos/sigmavirus24/github3.py/subscription"}, "response": {"body": {"encoding": "utf-8", "base64_string": "H4sIAAAAAAAAA52OSw6DMAxE7+I1kIZ+yTlYdYMCpGApkMh2KqGqd29Qe4Iun95oZl7AqeeBsHcjGKHkCsBpDbTjw3rOTM5yWMGsyfsChozixs4KGKgP+lrqutSXVjdG38y5uUMBiXyWs0hko5SNWE0oc+qrISyKXAysGKfFPpES1yf1tccqbup3JwrmyX07h1ECbd3/pfD+ADeEf+jnAAAA", "string": ""}, "headers": {"Server": "GitHub.com", "Date": "Sat, 16 Dec 2017 19:18:59 GMT", "Content-Type": "application/json; charset=utf-8", "Transfer-Encoding": "chunked", "Status": "200 OK", "X-RateLimit-Limit": "5000", "X-RateLimit-Remaining": "4959", "X-RateLimit-Reset": "1513452093", "Cache-Control": "private, max-age=60, s-maxage=60", "Vary": "Accept, Authorization, Cookie, X-GitHub-OTP", "ETag": "W/\"79a1be5aa0a5301a4089e12b59ff9399\"", "X-OAuth-Scopes": "admin:gpg_key, admin:org, admin:org_hook, admin:public_key, admin:repo_hook, delete_repo, gist, notifications, repo, user", "X-Accepted-OAuth-Scopes": "notifications, repo", "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": "*", "Content-Security-Policy": "default-src 'none'", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "deny", "X-XSS-Protection": "1; mode=block", "X-Runtime-rack": "0.025346", "Content-Encoding": "gzip", "X-GitHub-Request-Id": "9B88:17F6:17F899F:2B8CAA2:5A3571A3"}, "status": {"code": 200, "message": "OK"}, "url": "https://api.github.com/repos/sigmavirus24/github3.py/subscription"}, "recorded_at": "2017-12-16T19:18:59"}, {"request": {"body": {"encoding": "utf-8", "string": ""}, "headers": {"User-Agent": "github3.py/1.0.0a4", "Accept-Encoding": "gzip, deflate", "Accept": "application/vnd.github.v3.full+json", "Connection": "keep-alive", "Accept-Charset": "utf-8", "Content-Type": "application/json", "Authorization": "token <AUTH_TOKEN>", "Content-Length": "0"}, "method": "DELETE", "uri": "https://api.github.com/repos/sigmavirus24/github3.py/subscription"}, "response": {"body": {"encoding": null, "string": ""}, "headers": {"Server": "GitHub.com", "Date": "Sat, 16 Dec 2017 19:18:59 GMT", "Content-Type": "application/octet-stream", "Status": "204 No Content", "X-RateLimit-Limit": "5000", "X-RateLimit-Remaining": "4958", "X-RateLimit-Reset": "1513452093", "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": "*", "Content-Security-Policy": "default-src 'none'", "Strict-Transport-Security": "max-age=31536000; includeSubdomains; preload", "X-Content-Type-Options": "nosniff", "X-Frame-Options": "deny", "X-XSS-Protection": "1; mode=block", "X-Runtime-rack": "0.025839", "X-GitHub-Request-Id": "9B88:17F6:17F89A9:2B8CAB7:5A3571A3"}, "status": {"code": 204, "message": "No Content"}, "url": "https://api.github.com/repos/sigmavirus24/github3.py/subscription"}, "recorded_at": "2017-12-16T19:18:59"}], "recorded_with": "betamax/0.8.0"}
\ No newline at end of file
Loading
Loading
@@ -1006,6 +1006,7 @@ class TestRepository(helper.IntegrationHelper):
 
def test_refs(self):
"""Test the ability to retrieve the references from a repository."""
self.token_login()
cassette_name = self.cassette_name('refs')
with self.recorder.use_cassette(cassette_name):
repository = self.gh.repository('sigmavirus24', 'github3.py')
Loading
Loading
@@ -1089,7 +1090,10 @@ class TestRepository(helper.IntegrationHelper):
cassette_name = self.cassette_name('subscription')
with self.recorder.use_cassette(cassette_name):
repository = self.gh.repository('sigmavirus24', 'github3.py')
assert repository is not None
repository.subscribe()
subscription = repository.subscription()
repository.delete_subscription()
 
assert isinstance(subscription, github3.notifications.Subscription)
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment