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

Commit0f28da4

Browse files
committed
Add integration test to ensure the GitHub API allows for an empty blob
1 parentd57a7f5 commit0f28da4

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-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": {"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/github3py/fork_this"}, "response": {"body": {"base64_string": "H4sIAAAAAAAAA+1YTbOrKBD9Kym3kxeSeHMncfNmfsFs3mo2FioqdVUswKRyqfvfpxs0mtTki2ze4m5SBDmHQ9MN3ZiAZ0G02a7ed9u3edDQmgVRkAv5EeuSq2Ae5F1VxX1/wXXZJWF7JNMR4tAwGUQmqETBG4CfhgEc6Vd/bterzfs8oHuqqYw7WcGoUutWRYS4TrVwqE4xmYpGs0YvUlGTjvTon0BWyJ4BWYNw987CjG3CcL2kSb7bbjbZbrVOszDbvYWrHAAXM7W8n8VRw1SKTMWWuq4u1LnPdvx0ZC6qShwAf7mYm1OA2XoYGta2eVP4UADMEKFLBtaEZXyhcbjST8qxEAMLUzrmGZIo2B/Jsuck9SAQhJ7wZYhkrbBsXaJSyVvNRfOktDMoUAlZ0IZ/Ug8qgKIjo6gnRVgIQNke3PFJrMMY0kq+p+kRzSFZyvgerOvDdwEGOn1sMVj/mVgGbc41i2lWYyTmtFLsax5YDRoG2445hN5Dfn4W5Rk7bSVM+vfM2oZrIY8zLWaaKT3DQwEccyYw9PDPacKbcWiZxug6mxVZ7hj+KtwS4fZ9sKM3B2INgd8+QFKIWpoISWHl3qRnJIZM/6KfaEZrb24LBpJSCH/LWTCQcKU69pC7Xt8Fy6HIEA9NVyfuwHokCq7TOjRopErxomHM22InAkOGszSRtElLf8oBb4hr2V2lhbdExAJFUonEmwOuL2IJDFEldTeGjl9RhYyIPyOULH9JIuJPhFq+sK9WHhKc6OCi0rDF3voGPDG9BSvaFB0t/BlPBLC7eI0W9PNuUnE9JkYGoMMsSvKke+2gGjlQobvPIX79TThSjIQ2Qbidc9xY9CTJsMuua37vsr7O1sPPXPpFSvTDS1r8fz+nuC0T8YaM56k7rHtmX2v2p/Wgj5iRv0/Lvbd+wBPzR0t1iScQTNNSyXzF9nBiEgp5zmKxMCWjNo+tmXwhKh0aaKhMS8jYfPWZAQ+ZSE21zYxzlJdBplwJmnnb8kQAZG7LfDU69NSPWqj4vIVZ8JSt5hXkhqLxPyNHhilvIzTPefpIQXA9jM5IzE/Fm5TNaVXNwSs1Tzn4KSS0uGOQ9DF/qzg0yIf62lUCFQOX9bayZA5viCvbUskgv89iqiE3Xy9X6x/L3Y/V5tdyHb0tozD8F1bQtdnZmBDHrN9/rcPobRttljim7VR5hwZOs97VoAXl+/8VyGMKj/U28CpVjqC/RkjkmmcvCj0krcBnLpz6sbn2l1fJbRjIK0XNWrjGg6gB98Ua6hPaqyW8iEwu5VR0Ddh3OQ8OVEN2CJfg2DVc5ANFSVXsQiuItOyw6IKeMWwnnQf+wYdBrt4ZaWsupehfTJw20bKmZx6mB5mu1EFtk+9BBF8GrVZ4xnLaVTp2WSn4Sk2Vhscb2Hkma9CLhTo+5fQFpFOOXjEIxPh2bagrp0X59wOQe836fgD6fgCyT6S/0wNQw/QB33THg2Wayg+9X/8BrQS0aw4WAAA=", "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": "\"06d104120ba47b9295ef5fa4b563dd4c\"", "cache-control": "private, max-age=60, s-maxage=60", "status": "200 OK", "x-ratelimit-remaining": "4999", "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": "48A0C9F6:222E:1F8C28E:5351D6BD", "access-control-allow-credentials": "true", "last-modified": "Thu, 26 Sep 2013 23:48:50 GMT", "date": "Sat, 19 Apr 2014 01:51:58 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": "1397875918"}, "status": {"message": "OK", "code": 200}, "url": "https://api.github.com/repos/github3py/fork_this"}, "recorded_at": "2014-04-19T01:51:57"}, {"request": {"body": {"string": "{\"content\": \"\", \"encoding\": \"utf-8\"}", "encoding": "utf-8"}, "headers": {"Content-Length": "36", "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": "POST", "uri": "https://api.github.com/repos/github3py/fork_this/git/blobs"}, "response": {"body": {"string": "{\"sha\":\"e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\",\"url\":\"https://api.github.com/repos/github3py/fork_this/git/blobs/e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\"}", "encoding": "utf-8"}, "headers": {"content-length": "158", "vary": "Accept, Authorization, Cookie, X-GitHub-OTP", "x-xss-protection": "1; mode=block", "x-content-type-options": "nosniff", "etag": "\"067efaad5bebc27520ef74368ddfafd7\"", "location": "https://api.github.com/repos/github3py/fork_this/git/blobs/e69de29bb2d1d6434b8b29ae775ad8c2e48c5391", "cache-control": "private, max-age=60, s-maxage=60", "status": "201 Created", "x-ratelimit-remaining": "4998", "x-github-media-type": "github.v3; param=full; format=json", "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", "x-github-request-id": "48A0C9F6:222E:1F8C29E:5351D6BE", "access-control-allow-credentials": "true", "date": "Sat, 19 Apr 2014 01:51:58 GMT", "access-control-allow-origin": "*", "content-security-policy": "default-src 'none'", "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": "1397875918"}, "status": {"message": "Created", "code": 201}, "url": "https://api.github.com/repos/github3py/fork_this/git/blobs"}, "recorded_at": "2014-04-19T01:51:57"}], "recorded_with": "betamax/{version}"}

‎tests/integration/test_repos_repo.py

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

55

66
classTestRepository(IntegrationHelper):
7+
deftest_create_empty_blob(self):
8+
"""Test the ability to create an empty blob on a repository."""
9+
self.basic_login()
10+
cassette_name=self.cassette_name('create_empty_blob')
11+
withself.recorder.use_cassette(cassette_name):
12+
repository=self.gh.repository('github3py','fork_this')
13+
assertrepositoryisnotNone
14+
blob_sha=repository.create_blob('','utf-8')
15+
16+
assertblob_shaisnotNone
17+
assertblob_sha!=''
18+
719
deftest_create_deployment(self):
820
"""Test the ability to create a deployment for a repository."""
921
self.basic_login()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp