Skip to content

Commit f3ad49f

Browse files
committed
Fix bug. Add integration test for latest_pages_build
- Add cassette for integration test
1 parent 5b9413f commit f3ad49f

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

github3/repos/repo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1065,7 +1065,7 @@ def latest_pages_build(self):
10651065
"""
10661066
url = self._build_url('pages', 'builds', 'latest', base_url=self._api)
10671067
json = self._json(self._get(url), 200)
1068-
return PagesBuild(json, self) if json else None
1068+
return PagesBuild(json) if json else None
10691069

10701070
def iter_assignees(self, number=-1, etag=None):
10711071
"""Iterate over all available assignees to which an issue may be
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"http_interactions": [{"request": {"body": {"string": "", "encoding": "utf-8"}, "headers": {"Accept-Encoding": "gzip, deflate, compress", "Accept": "application/vnd.github.v3.full+json", "User-Agent": "github3.py/0.8.2", "Accept-Charset": "utf-8", "Content-Type": "application/json", "Authorization": "Basic <BASIC_AUTH>"}, "method": "GET", "uri": "https://api.github.com/repos/sigmavirus24/github3.py"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA62Yy5LqNhCGX4XyNgzCXAdvTrJKsjuLk002lGzLWDW25ZJkKMY1755flq+cBIZRNhQY9adfrW65W7XHYy9Y7/3l3vfnXkFz5gXeieu0CteL8urNvaTKsmP7h+KnnJ65rNRqQyajxKVg0gtqLxMnXoAxHgqKmWa1Wb6ul3OPnqmm8ljJDONSrUsVEGIfqoWlVorJSBSaFXoRiZxUxBp/A+okW4BhepG/eV1vd/HrITmstmx3WPn715AxPz6saZTsYXAzUcnbSSwZMylyozbVeXajz+pqTG4GJyLLxAWU2xU9moj0lsbNDYUXpy9SYFkToVMGx2JJH8ZRXOnnRTVWNXZX6SOPDUdhtySLnxbW2kGWCY6PmkhWigZYhSqSvNRcFM8LnFiDJuSJFvydfo0GawWIkfa8lMYK1uyMQH3e3JrVpJT8T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JesVNjJIzLlM5X+49/ALYpvtVvEwAA", "encoding": "utf-8"}, "headers": {"vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding", "x-github-media-type": "github.v3; param=full; format=json", "x-xss-protection": "1; mode=block", "x-content-type-options": "nosniff", "etag": "\"d3ccbef25c4850c0d561a3f11a05ac7e\"", "cache-control": "private, max-age=60, s-maxage=60", "status": "200 OK", "x-ratelimit-remaining": "4969", "x-served-by": "62a1303ae95931e56e387e87d354bb24", "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", "transfer-encoding": "chunked", "x-github-request-id": "48A0C9F6:1928:A71C3:534E6EC9", "access-control-allow-credentials": "true", "last-modified": "Wed, 16 Apr 2014 11:46:09 GMT", "date": "Wed, 16 Apr 2014 11:51:37 GMT", "access-control-allow-origin": "*", "content-security-policy": "default-src 'none'", "content-encoding": "gzip", "strict-transport-security": "max-age=31536000", "server": "GitHub.com", "x-ratelimit-limit": "5000", "x-frame-options": "deny", "content-type": "application/json; charset=utf-8", "x-ratelimit-reset": "1397651155"}, "status": {"message": "OK", "code": 200}, "url": "https://api.github.com/repos/sigmavirus24/github3.py"}, "recorded_at": "2014-04-16T11:51:37"}, {"request": {"body": {"string": "", "encoding": "utf-8"}, "headers": {"Accept-Encoding": "gzip, deflate, compress", "Accept": "application/vnd.github.v3.full+json", "User-Agent": "github3.py/0.8.2", "Accept-Charset": "utf-8", "Content-Type": "application/json", "Authorization": "Basic <BASIC_AUTH>"}, "method": "GET", "uri": "https://api.github.com/repos/sigmavirus24/github3.py/pages/builds/latest"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA52U3Y6rIBSF34XrThGsCt7MS5xzMzcNCloSFcKPk47pu8+WNidTTzKJvTPAt/ZisbcLim5ANbqEYH2NsbD62Otwic2xNSN2yhqPve5HMWsXPT3h+25+tFdsRa88bqIepMc5IQVjDB2QDyJED6LrToAF5ZxxqF7QqLwHBtVTHIbbAdnoLyrtDKbXEyA/SwGpJarpKWN5dkBiFkG488ZvWvQPz9Er15opqCkk+xHf4XeQ6t1DYNVELTmxvCgl4x2nhSo5JRVrlCKS56LtKgB+DWat9BwMEJcwDht/P7LcXK0zw2A+QWV7o+cX+L8Q/kdCyfu3nvoXVYBcsAnwCue10m0NSvuw31SiFugOH85arjrQBs4pudvYgwNbnxM4WlITJsHY+NZpG7SZ9ht8okHNuF5M+ku8pga0B5E0H7tvmCig1QyNuh+/Ywu2Ts+iva7RONUqPUPYL0pueFAMVwtziv5CU6zR66DOQo7rjHZi8AqGFwZs1AHO0EZydhKElnnHS1VxkomiEg1ngueStSwr4M+Qc9CR0aXAUU0IqUDDKRHAtkg6GcnfsuqNln9oVtOizooPYKKVv50pP9DtG95gkNLGBAAA", "encoding": "utf-8"}, "headers": {"vary": "Accept, Authorization, Cookie, X-GitHub-OTP, Accept-Encoding", "x-github-media-type": "github.v3; param=full; format=json", "x-xss-protection": "1; mode=block", "x-content-type-options": "nosniff", "etag": "\"21be448cb6a20329feb5e91c4c8fa47b\"", "cache-control": "private, max-age=60, s-maxage=60", "status": "200 OK", "x-ratelimit-remaining": "4968", "x-served-by": "6d7de9e645814cac34ea2a8d72ba3141", "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", "transfer-encoding": "chunked", "x-github-request-id": "48A0C9F6:1928:A71DE:534E6EC9", "access-control-allow-credentials": "true", "last-modified": "Fri, 26 Jul 2013 20:25:06 GMT", "date": "Wed, 16 Apr 2014 11:51:37 GMT", "access-control-allow-origin": "*", "content-security-policy": "default-src 'none'", "content-encoding": "gzip", "strict-transport-security": "max-age=31536000", "server": "GitHub.com", "x-ratelimit-limit": "5000", "x-frame-options": "deny", "content-type": "application/json; charset=utf-8", "x-ratelimit-reset": "1397651155"}, "status": {"message": "OK", "code": 200}, "url": "https://api.github.com/repos/sigmavirus24/github3.py/pages/builds/latest"}, "recorded_at": "2014-04-16T11:51:37"}], "recorded_with": "betamax/{version}"}

tests/integration/test_repos_pages.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44

55

66
class TestRepositoryPages(IntegrationHelper):
7+
def test_latest_pages_build(self):
8+
"""Test the ability to retrieve the latest pages build for a repo."""
9+
self.basic_login()
10+
cassette_name = self.cassette_name('latest_pages_build')
11+
with self.recorder.use_cassette(cassette_name):
12+
repository = self.gh.repository('sigmavirus24', 'github3.py')
13+
assert repository is not None
14+
latest_build = repository.latest_pages_build()
15+
16+
assert isinstance(latest_build, github3.repos.pages.PagesBuild)
17+
718
def test_pages(self):
819
"""
920
Test the ability to retrieve information about a repository's pages.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy