Commits

Ian Cordasco committed 6e47e83

Add integration test for GitHub#iter_forks

Comments (0)

Files changed (2)

tests/cassettes/Gist_forks.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/VaPC2UCFVe/4ar1a5RKErVtqmfFOB9u4dLi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WEA85DiVyHOYiiKKChoziNCMcI0/OQ0rH0NEw6DUdh5E3ucoAMNFyDjp2qq6Cx03I7XOxVXguKnaaxiNgJjofDTvQ2WOhYciEQ9pE5BAK8WeAJxc+Y+Bz72DsGhMM2ZwLBQ8T1WL2Z1+8d+1wDKg9L8RLnVUFYCwXCkHsxFBrhQyhIzFzK7dD1Io9AuQ5KSY4bKIVDjwoZOedBYWDtaTAMGo+CQ1f2ckAc0XINJHrqrgJFT9PtYNFXey0wetrGQqMnPB4cPfHbwGNg0YUA2UfyEYBABcN+RtRnrk/fq2AM2pwLEIII8vARgLx+UWmqwrXMWnxQ10GOrrtf9KLSSh8CJHId7lKhPEWIdLkDKQXnrnS8iHvUldF5AOlZexofvaaj4LGXvBwdBzquAUdH2VXY6Oi5HTS6Sq9FRkfXWGB0RMfjoiN8G1j0rLkUFbuYPYoKAsVO6hPHx3Uh80ixk0x6bbafoU4HRassX5t1jWOQStzLjta97FhXwscV7u5lx30pHKq446P9BcrhzfcHGnkSYVtKVwaeoApHkrsK9koXvvTYgcspo1Do09m2/oCgPyof+QTi+YRDDqGpIOEz+VzNgPZlVZ8OKLMSSpI+cWF/D8O4Xm0oTlL9JSRRb5cciqEny4ZNCbQ942CdbXadrdyxMzzncsfOHTvf/2vHHjtSChEy+FLoBNRhTAYuJOhOEMFnBaUcD87oCMkJ1zn6Sexg20fkJHb61OlDZxxzzrb5zpyjZ+vuzLkz53/JHDh9pewIBULCoTQUBowRT7iuQNSFCmMgXBERJ8Lym8xB7QvQe6mO02MOXHUSHTSOOWfbfGfOnTn3Ux36KPBtyim7k8XXvV4FUkrGvCiIhIOVxySzuWaNF4QYMcWQjELpIfdbzEHcJ3XR5T3m4D509OXl1Dnb6jt17tS5U+f/jjoEU0oxthl88SBwokIFAYocbMOpXQ/bBM6dC4ldR5ymTudc63ehztlWbz9v/wtnA040xzMAAA==", "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": "57", "x-served-by": "d818ddef80f4c7d10683dd483558952a", "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:43A0:2BEE9CB:535717B6", "access-control-allow-credentials": "true", "last-modified": "Tue, 22 Apr 2014 21:38:10 GMT", "date": "Wed, 23 Apr 2014 01:30:30 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:30:12"}, {"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/forks?per_page=100"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA7WW27KiOBSG34Vrd5MD4XQzV/MG3Tc9NWVFCJppBIqDu/ZYvvusIBsTxB6C7jtL8/1ZrKx88tfZ6erciZ1D21ZN7Lq8kt/2sj10u29JeXT3smkb1yeMYsScjZOV9a9muxxxewBACDvK1godEIBlChXeioD6tlWX55M6VK167QOgvoKMK9QcrKBDe1y4i+qNzEXjxOfLxqm6XS4TJ27rTsCz14K3It3yFh6DIEzfUPiG/e8ExciPMf0JcFel/7smFU1Sy6qVZeHEBTTg2lZRtLAtgoxG1NMfbM5KNbwP2zjle6Gyzk5e7iXs5hzlvhN5wusT/4fnw5lgnxHiRRuHn3jL6+le/ZfNcCSquKQsWtign6zOHeg/1OHUQ0J/0inBhBCfZkgEmCJvxxIiOEIkCxilAVHt+t3Qqq0a967i2cMcJ/1ueVbmefkOSdPHMm/I3GYw9QOrxqL/LIv96hxgz27ZHgR0GB7t0k8z3MsVgT137q/1VqYqqYEzqmE4rTvqDiSUpoblcnZrUZV9ZLcbB3VNkQavhrHe80L+y9Xgr8kDXs20Km8N3nPAi5O6HCsadQXPblXLE08+VItqkQh5gravDp0kQGb7UQm4PT+UBeAQZCu2PD2q25vxvBGXy2aR7MOAYhYgiFgs+wFZI/tPdCL7WxELZT8AdrI3oVk/mH8pWm+Wyt57Q/iN4u+YxAzHOJqT/dyar5K93vBHsv8z7zJ5LE8wA0rIHqGg4ZWWv8L3kvdFhneMpQkKAy9AFGU7mgaC0YwwDP+RsPcCJWmVzh7fqHdtoZXYP7n1Sp8kPCPzMeopjY8prxP4LVJXPxyhtbrHJFtpj6C9rkf0NaLWKjEk/zpFR4iEkafegxYrekDWKPoTnSj6VsRCRQ+AnaJNaPaOm4rWemOhaKLexxGNvTCm6IGi79Z8laL1hj9SdCP3R36SddcQb9A08VC4WtNX+F7TCfZCyvw0jLKIMOFHBAfhTgicRpQnWbBM05NqZ49xVPVksZWudXa9smdSntG2EfeUuo2k1+nbjH1W4UaarcYN2F7lBv4anU8q+iqlE0RQhK2UfkVWKX1Ap0ofi1iq9CtgqXQDmnXBROm33lgpnTCldBLE2Huo9MmaL1O61vBHSn//JYpCpB9JOQidhgEKiL/yxXug75WehQELKReRICQJWQCv3YyFSRBlLKJhki1TulHt7CGOQjeWWun8Rq6X+V3GMyrXwp4SuZbzOo3roc9KXMuyVbiG2gtcg1+jb6Maa3n//R+S5vbyIRcAAA==", "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": "56", "x-served-by": "d818ddef80f4c7d10683dd483558952a", "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:43A0:2BEEA3D:535717B6", "access-control-allow-credentials": "true", "last-modified": "Tue, 22 Apr 2014 21:38:10 GMT", "date": "Wed, 23 Apr 2014 01:30:30 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/forks?per_page=100"}, "recorded_at": "2014-04-23T01:30:12"}], "recorded_with": "betamax/{version}"}

tests/integration/test_gists.py

             assert gist is not None
             for commit in gist.iter_commits():
                 assert isinstance(commit, github3.gists.history.GistHistory)
+
+    def test_iter_forks(self):
+        cassette_name = self.cassette_name('forks')
+        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_forks():
+                assert isinstance(commit, github3.gists.gist.Gist)