Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit905bd7d

Browse files
committed
Add tests around GitHub#user, GitHub#repository
1 parent7b2d0d2 commit905bd7d

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-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": "", "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.0"}, "method": "GET", "uri": "https://api.github.com/repos/sigmavirus24/github3.py"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA62YTY+jOBCG/0qENHvZTBwCCWmk0exc9uM2h9nLXCIDBqwGjGyTbBr1f9/XQIBE2qS7vVIrSmjX45dylV3l1uGJE3qBuw5cd+lUtGRO6GRc503kreqzs3TSpigOwz8Uz0p65LJRG59cjRKnikknbJ1CZLwCYz4UFDPNxl/vvfXSoUeqqTw0ssC4XOtahYS4q0z2/1jFoiT9VxK7/t7b7pL9U/q02bLd08YN9hFjbvLk0TgNviZfOsAn79unze/44wmrNI9FpVa9PkPDc58GbrDz154fJ5Ttg8Df+xELNoG7j+h2s1vVVfaL/PIPpF50HIxm55ECGFy/CK35bGrSKCYVufFGrsvi5v0ntbeDU1EU4gTKjcXDichoaZaxo/Aq+yAFli0ROmdYOLzSq3EUV/r9ojqrFtGjNDxsOArRIFnybmGDHWSZ4HttiWS16IBNpGLJa80RB+/Hzq1BEzKjFX+hH6PBWgFipL1fSmcFa3ZEVL/fvDdrSS35kcZn4xrJYsaPcPYHkTf2IOpzbfaMvxEUxvVcswNNSrMHpLRQ7HXpdNNrDOoeLJHyb43+6z0mYeOqYsLvZ52LalHwSFJ5XqRCLnilmUxpjFhdnLCHLRCuiz+4/rOJFt++/3X0IBDjnkcldzO3c/5VMl7LMaQHa3IXgfQEAJKe2dmKY+xbgs8hn2KkOo2EpFo82jTuC7wCtWT+08SSZrS0Et4BAMqFsPNkBwCIK9WwN4X2/RfvOIpc8qdqyqjf8t6SNffRPQFaqcKhUDFm5cER0nYHjVkVpEMV53bYC6Ml/bdutWlmJdXYG3mFiKw4OChJB2mJyml/DumDrTpDNYwrqGSptVTDGKFaWq53J9NARiQOQY2lt9J5YZB28GhBq6yhmR11hGDVzVGd0ZeHRcz93JkoQKLG05JHjf0mN3GM0v70R77buXTCTNCuILlfjzxwwKw06VxQlvxRXXCfOCCuwv5/wJo4vUWb34/LmMdyDaMl057cb/oD3ca7w65/0UnaaQ4TbPbaewZpf62pzs3OhalqKpmN6AFB2oii2FqtVm3OaFdWl0xaZnBPAIrKOEfVaKOzvTBQ9ZRUd9V6amQmqN4LQROrdBshAPbLaKO1J8xjrEYTbCWwA8yJJS+Y0qKy22MnypxdCc1THr+lY7mfbleg9qviVcyWtCiWiFp02RxxjFrbrCIKTmbnoZ6A18AdhCFKVjCEtJXXL4yW9J1mLBkakeRANRqIzdrdfF57n13vh/sUbvfh1vuJeZs6uRqDAe7n9fbH2g/XQejtzJi6UfkMczPEN0OwAw4hiG+438An7lS6u43/uEUxtwYwVCqfDH+bzML7ZnGBWLoJ+rfPebw9lh6bQmouSlajTBiucca39OrzCp5O0H4lIlYr9MDEvBl/wVDP3+2WzolqFKk4Y2PRVFgN1/NNEPVlx9jdmTmoOvT56IRaNqZ9xJMp32cPT/yZj61d350NdB/wkksphlunCtmIxr5m1cAeZWBg35aFxmY2AhLx4CJ7EJywlDaFPvRVMmQnKO8LUUN3xfQJ/d0F7Puv/wLrfwkFbBMAAA==", "encoding": "utf-8"}, "headers": {"status": "200 OK", "x-ratelimit-remaining": "59", "x-github-media-type": "github.v3; param=full; format=json", "x-content-type-options": "nosniff", "access-control-expose-headers": "ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes", "transfer-encoding": "chunked", "x-github-request-id": "4B79B570:59C7:20EDB5B:527999CB", "content-encoding": "gzip", "vary": "Accept, Accept-Encoding", "server": "GitHub.com", "cache-control": "public, max-age=60, s-maxage=60", "last-modified": "Tue, 05 Nov 2013 04:07:36 GMT", "x-ratelimit-limit": "60", "etag": "\"60e5edc5a06f4b17e2943b93c0ae2e40\"", "access-control-allow-credentials": "true", "date": "Wed, 06 Nov 2013 01:22:19 GMT", "access-control-allow-origin": "*", "content-type": "application/json; charset=utf-8", "x-ratelimit-reset": "1383704539"}, "url": "https://api.github.com/repos/sigmavirus24/github3.py", "status_code": 200}, "recorded_at": "2013-11-06T01:22:19"}], "recorded_with": "betamax"}

‎tests/cassettes/GitHub_user.json‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"http_interactions": [{"request": {"body": "", "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.0"}, "method": "GET", "uri": "https://api.github.com/users/sigmavirus24"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA51UTWvjMBD9K0XQPTmR5Y/YMZTuByz0sLcuC70EWZIdUVkykmxvNnR/+46ctJvmUhIw2Fjz3rwZzZs9UqaVGlXIybajo7SDSzIUIclRlWRxmcYRoiP11G4GqyBu633vKoyTZWsPB0tmOnz4xIxkZZqveLlu1kkuVuuEFGUtBOHrlLKmuOd3M8Ft+uU2+Q6P5EJ7yYx2y1b67VAHNvif0YIUqyxOM8apKIsiK7NaFElByprmyWrZ6/aTvfsNUl91bIJm9JECALwvhPbyJDUenLAOn3Vj6zt1Vv9/tefBjVHKTMByhvgwEX5DgsjDt9TtlSyA3GPjtwIuDkp6CY2Szl8uakbtcXhBhwOPg2mwgl8s7IgDWZMGRXtsRW9mwqF2zMreS5iDy2lP0cBmbEu1/EOvYwO0A5Ig7XIpMwrQYoSpvhx+gO1xb+VI2S60xgom5AjNvpLyDA+MftcL8MlPGIrQeunFhvIu7ICGKicipGkXAh6ovvlmLKeOGQgEW/ZU7+Dgq9B8Nxn7HCqtYX8ctwIshWmawL+tkrON8V8w9kyA57AIlg2brwUQPyiXzujo5tdDaFhHZdgu4OWmoZ4ZBYpaM36GpSRVIIOgrbSC1grEHZXW0qBKD0pFqB9qJdnmcAFVXrwaCGyIqjw/8RPsNThlQOWhrdRD1iQm8SLOFiR+jLMqLqo0eYJ8Q8/fxaQLQhbx6jEmFSFVmj2hl38OqrsDQAUAAA==", "encoding": "utf-8"}, "headers": {"status": "200 OK", "x-ratelimit-remaining": "58", "x-github-media-type": "github.v3; param=full; format=json", "x-content-type-options": "nosniff", "access-control-expose-headers": "ETag, Link, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes", "transfer-encoding": "chunked", "x-github-request-id": "4B79B570:17A7:2B77158:52799A0E", "content-encoding": "gzip", "vary": "Accept, Accept-Encoding", "server": "GitHub.com", "cache-control": "public, max-age=60, s-maxage=60", "last-modified": "Wed, 06 Nov 2013 01:11:34 GMT", "x-ratelimit-limit": "60", "etag": "\"3c900861c3d55200d30fb445abc055f9\"", "access-control-allow-credentials": "true", "date": "Wed, 06 Nov 2013 01:23:27 GMT", "access-control-allow-origin": "*", "content-type": "application/json; charset=utf-8", "x-ratelimit-reset": "1383704539"}, "url": "https://api.github.com/users/sigmavirus24", "status_code": 200}, "recorded_at": "2013-11-06T01:23:27"}], "recorded_with": "betamax"}

‎tests/integration/test_github.py‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,19 @@ def test_create_key(self):
5555
assertisinstance(k,github3.users.Key)
5656
assertk.title=='Key name'
5757
assertk.key==SSH_KEY
58+
59+
deftest_repository(self):
60+
"""Test the ability to retrieve a Repository"""
61+
cassette_name=self.cassette_name('repository')
62+
withself.recorder.use_cassette(cassette_name):
63+
r=self.gh.repository('sigmavirus24','github3.py')
64+
65+
assertisinstance(r,github3.repos.repo.Repository)
66+
67+
deftest_user(self):
68+
"""Test the ability to retrieve a User"""
69+
cassette_name=self.cassette_name('user')
70+
withself.recorder.use_cassette(cassette_name):
71+
r=self.gh.user('sigmavirus24')
72+
73+
assertisinstance(r,github3.users.User)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp