Commits

Ian Cordasco  committed a88f414

Add integration test for Gist#iter_commits

  • Participants
  • Parent commits 465e964
  • Branches new-pagination

Comments (0)

Files changed (2)

File tests/cassettes/Gist_commits.json

+{"http_interactions": [{"request": {"body": {"base64_string": "", "encoding": "utf-8"}, "headers": {"Accept-Charset": "utf-8", "Content-Type": "application/json", "Accept-Encoding": "gzip, deflate, compress", "Accept": "application/vnd.github.v3.full+json", "User-Agent": "github3.py/0.8.2"}, "method": "GET", "uri": "https://api.github.com/gists/1834570"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA+2aXY7juBGAr6IIGOxLu8Vf/aE3Pw8BFovMW+dhMx4YFEXZ2pElQz/d8XgN5DQ5Qi6Qm+QkKUpqW5LdHss2JnkwMIO2JFaxSFZ9LJW4Mas8MX1zUZarwrcssYof53G5qIJHmS2teVyUhYVdyriDzAczyvIvxex8EasWAEFQtozLUaKtCAjHIVi4NwLsm62qJBnYoW3t2t4K6FugoxEqFqOEFuXyzF703MSJKkx/Y85klkbx/HG9hJnd1PdTsVQwhu6TB7Ncr/TNUv29tNYCGj+YiUjnlZjr27/86eNf4E4uXt83uSpUDp2VKi3r5crFiyjKRfy2YnDj1VKUCztEPFKBKzl1SCAiHvKIR8hxRYgFixTnyrb61hXxVzCDEVsvXt0FGCWqcpHlhT9NDWMh0q9ZVf80DD1A3/ipvgV/yjLL4+ZJGBerRKxn3RbNk7k2txS5b0jb9rAnA+yxyLOlDf9xKJBkDuVM2KJpr5YiTvy23z/CeFciXetxN49fVQAPwY/BjQ8elq9xWSrdVSPWWlB7Okgt9hb/muVzlfaG9fO//6XvGR+zHOahUOmxkbWNhkPDRDEXCWozwSX2CIYRegELI+UJjEPeG1rT902H1qiEKTK3D+YqgxDRTj3wy/39vlfWTXte+dPzjbwS48ihwnUIeCZxlRQOD5WjbBYEHg8ZJYTYQWA7Vte21icZ6vrk5oMhiiKep0bjncaPRhGX6rH11U8riKf24rPxYTtNn0RexjJRhkxA8MepCb6dr6fm7/VaPC2U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oding", "x-github-media-type": "github.v3; param=full; format=json", "x-xss-protection": "1; mode=block", "x-content-type-options": "nosniff", "etag": "\"7f68f520549e5dc4d76ce2fb5727ad3a\"", "cache-control": "public, max-age=60, s-maxage=60", "status": "200 OK", "x-ratelimit-remaining": "59", "x-served-by": "a8d8e492d6966f0c23dee2eed64c678a", "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": "48A0C5F1:4A38:2EB90B7:535716C9", "access-control-allow-credentials": "true", "last-modified": "Tue, 22 Apr 2014 21:38:10 GMT", "date": "Wed, 23 Apr 2014 01:26:33 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": "60", "x-frame-options": "deny", "content-type": "application/json; charset=utf-8", "x-ratelimit-reset": "1398219993"}, "status": {"message": "OK", "code": 200}, "url": "https://api.github.com/gists/1834570"}, "recorded_at": "2014-04-23T01:26:14"}, {"request": {"body": {"base64_string": "", "encoding": "utf-8"}, "headers": {"Accept-Charset": "utf-8", "Content-Type": "application/json", "Accept-Encoding": "gzip, deflate, compress", "Accept": "application/vnd.github.v3.full+json", "User-Agent": "github3.py/0.8.2"}, "method": "GET", "uri": "https://api.github.com/gists/1834570/commits?per_page=100"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA+2YzY7aMBSF3yVrOvFfYjubvkS7aVWNrv/AUkhQYhhNEe/e6zCtBhYMGXXBIitw5HN8cuP74fDzWOxHPxTNsWj7deyKphjgAGPaxGJVRFc0iitFVwVeTDA874cWp2xS2o1NWZ4vjk/rmDZ7k41s3yXfpSfbb8t9OWm/otE6m2Z9diyIqU1gIDQ1nApNnCCcueCok8Jo7lBwtc4uvq1xNsaFxvJdzk3atlfRzpGm6e8mhr5t+xdUX9/IrQXKfyoMdv4eu/UnHFB1LPu08VhHvIVTLkwc07wwk+JY5g+sZvYYsbCDd7MCvWkwzkuHSY7l4Hf9ZLY3ox3iLsW+mxfsQolO/bCGLv6G+U6oHNEgR5oXYVKg0h9wD86TniXHcjfEA9jXXIrBWx8PWNhP2F1p0S297jzu/e+527DMMflncNvccQHa0Z9WxQH3JVYdJ/GgLaG1tcoaDdzTYCvlJXdKOKiNqrjgxEuJRrjBtzElTAkJlYxQ9oWwL7T6RnTDqkaoH3nWBrq1f8annvZjbvbUJ8BOZgo727k4PaOioXxVON/6v8MKU93sxGkzllRxUUlS3h37tFqwM/Fzwc6CHSTVg2DHWgAn8CdbGi6FsEapSkoTah68l5qCAFuxKnyEHVo3hN3EziV1LqEzjzl3Z16Y83ZmW5izMOdxmMNB+ToQA5ZRQZwRgmlQCghXQTMDCgKTgdoPmUMaKm4xR14wB0fvDjpkHnPuzrwwZ2HO8nqF/yWUD/V6Zay1QuhgAkjqtbCirjJrtHGUCC+IDc5qoj5iDqkadpM59BI6efh56tydeqHOQp2FOg9HHUY555TWwsmKSSG9MSRIWnOoNa2Z8xIsVRJuU0c1lW4EuXXS+a/UuTv16dcfkR+tjEwWAAA=", "encoding": "utf-8"}, "headers": {"vary": "Accept, Accept-Encoding", "x-github-media-type": "github.v3; param=full; format=json", "x-xss-protection": "1; mode=block", "x-content-type-options": "nosniff", "etag": "\"7f68f520549e5dc4d76ce2fb5727ad3a\"", "cache-control": "public, max-age=60, s-maxage=60", "status": "200 OK", "x-ratelimit-remaining": "58", "x-served-by": "c046d59f93ede9ab52d5ac29f1ed70f7", "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": "48A0C5F1:4A38:2EB9114:535716C9", "access-control-allow-credentials": "true", "last-modified": "Tue, 22 Apr 2014 21:38:10 GMT", "date": "Wed, 23 Apr 2014 01:26:33 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": "60", "x-frame-options": "deny", "content-type": "application/json; charset=utf-8", "x-ratelimit-reset": "1398219993"}, "status": {"message": "OK", "code": 200}, "url": "https://api.github.com/gists/1834570/commits?per_page=100"}, "recorded_at": "2014-04-23T01:26:15"}], "recorded_with": "betamax/{version}"}

File tests/integration/test_gists.py

+from .helper import IntegrationHelper
+
+import github3
+
+
+class TestGist(IntegrationHelper):
+    def test_iter_commits(self):
+        cassette_name = self.cassette_name('commits')
+        with self.recorder.use_cassette(cassette_name,
+                                        preserve_exact_body_bytes=True):
+            gist = self.gh.gist(1834570)
+            assert gist is not None
+            for commit in gist.iter_commits():
+                assert isinstance(commit, github3.gists.history.GistHistory)