diff --git a/github/tests/NamedUser.py b/github/tests/NamedUser.py index 5a56bd19..5ef9de68 100644 --- a/github/tests/NamedUser.py +++ b/github/tests/NamedUser.py @@ -92,14 +92,6 @@ class NamedUser(Framework.TestCase): self.assertEqual(self.user.type, "User") self.assertEqual(self.user.url, "https://api.github.com/users/jacquev6") - def testCreateGist(self): - gist = self.user.create_gist(True, {"foobar.txt": github.InputFileContent("File created by PyGithub")}, "Gist created by PyGithub on a NamedUser") - self.assertEqual(gist.description, "Gist created by PyGithub on a NamedUser") - - def testCreateGistWithoutDescription(self): - gist = self.user.create_gist(True, {"foobar.txt": github.InputFileContent("File created by PyGithub")}) - self.assertEqual(gist.description, None) - def testGetGists(self): self.assertListKeyEqual(self.user.get_gists(), lambda g: g.description, ["Gist created by PyGithub", "FairThreadPoolPool.cpp", "How to error 500 Github API v3, as requested by Rick (GitHub Staff)", "Cadfael: order of episodes in French DVD edition"]) diff --git a/github/tests/ReplayData/NamedUser.testCreateGist.txt b/github/tests/ReplayData/NamedUser.testCreateGist.txt deleted file mode 100644 index 23fa8156..00000000 --- a/github/tests/ReplayData/NamedUser.testCreateGist.txt +++ /dev/null @@ -1,11 +0,0 @@ -https -POST -api.github.com -None -/users/jacquev6/gists -{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} -{"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true, "description": "Gist created by PyGithub on a NamedUser"} -201 -[('status', '201 Created'), ('x-ratelimit-remaining', '4961'), ('content-length', '1461'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"a0bf182f5ec61a0c78e9078da61ef220"'), ('date', 'Sun, 20 May 2012 12:14:08 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/2757859')] -{"updated_at":"2012-05-20T12:14:08Z","forks":[],"url":"https://api.github.com/gists/2757859","comments":0,"public":true,"git_pull_url":"git://gist.github.com/2757859.git","git_push_url":"git@gist.github.com:2757859.git","files":{"foobar.txt":{"type":"text/plain","size":24,"filename":"foobar.txt","raw_url":"https://gist.github.com/raw/2757859/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","content":"File created by PyGithub","language":"Text"}},"html_url":"https://gist.github.com/2757859","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146},"description":"Gist created by PyGithub on a NamedUser","created_at":"2012-05-20T12:14:08Z","id":"2757859","history":[{"change_status":{"deletions":0,"additions":1,"total":1},"url":"https://api.github.com/gists/2757859/a371de5450f93699fe3cb0386897abe69cdc967e","committed_at":"2012-05-20T12:14:08Z","version":"a371de5450f93699fe3cb0386897abe69cdc967e","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":327146}}]} - diff --git a/github/tests/ReplayData/NamedUser.testCreateGistWithoutDescription.txt b/github/tests/ReplayData/NamedUser.testCreateGistWithoutDescription.txt deleted file mode 100644 index 5ee43ca0..00000000 --- a/github/tests/ReplayData/NamedUser.testCreateGistWithoutDescription.txt +++ /dev/null @@ -1,11 +0,0 @@ -https -POST -api.github.com -None -/users/jacquev6/gists -{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} -{"files": {"foobar.txt": {"content": "File created by PyGithub"}}, "public": true} -201 -[('status', '201 Created'), ('x-ratelimit-remaining', '4959'), ('content-length', '1424'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"70ddb8edc443c90302048551cc26e7b9"'), ('date', 'Sat, 26 May 2012 11:08:22 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/gists/2793505')] -{"git_push_url":"git@gist.github.com:2793505.git","updated_at":"2012-05-26T11:08:22Z","url":"https://api.github.com/gists/2793505","comments":0,"public":true,"forks":[],"files":{"foobar.txt":{"type":"text/plain","raw_url":"https://gist.github.com/raw/2793505/73a1c7f17aa0ad5d7cbb5a8ca033ce47d3d23197/foobar.txt","size":24,"filename":"foobar.txt","content":"File created by PyGithub","language":"Text"}},"user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"},"description":null,"created_at":"2012-05-26T11:08:22Z","git_pull_url":"git://gist.github.com/2793505.git","id":"2793505","history":[{"url":"https://api.github.com/gists/2793505/a456dbfb5e6fd94cb96beba0a2c5684b251d3384","version":"a456dbfb5e6fd94cb96beba0a2c5684b251d3384","change_status":{"deletions":0,"additions":1,"total":1},"committed_at":"2012-05-26T11:08:22Z","user":{"url":"https://api.github.com/users/jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146,"avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png"}}],"html_url":"https://gist.github.com/2793505"} - diff --git a/github/tests/ReplayData/Repository.testCreateDownloadWithAllArguments.txt b/github/tests/ReplayData/Repository.testCreateDownloadWithAllArguments.txt deleted file mode 100644 index da494b68..00000000 --- a/github/tests/ReplayData/Repository.testCreateDownloadWithAllArguments.txt +++ /dev/null @@ -1,11 +0,0 @@ -https -POST -api.github.com -None -/repos/jacquev6/PyGithub/downloads -{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} -{"description": "Download created by PyGithub", "name": "Foobar.txt", "content_type": "text/richtext", "size": 1024} -201 -[('status', '201 Created'), ('x-ratelimit-remaining', '4957'), ('content-length', '1172'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"dec219bef9e193a28a08c8f5643c0ac3"'), ('date', 'Tue, 22 May 2012 19:11:49 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/downloads/242556')] -{"description":"Download created by PyGithub","acl":"public-read","accesskeyid":"1DWESVTPGHQVTX38V182","bucket":"github","content_type":"text/richtext","x-amz-meta-content-disposition":"attachment; filename=Foobar.txt","redirect":false,"expirationdate":"2112-05-22T19:11:49.000Z","policy":"ewogICAgJ2V4cGlyYXRpb24nOiAnMjExMi0wNS0yMlQxOToxMTo0OS4wMDBaJywKICAgICdjb25kaXRpb25zJzogWwogICAgICAgIHsnYnVja2V0JzogJ2dpdGh1Yid9LAogICAgICAgIHsna2V5JzogJ2Rvd25sb2Fkcy9qYWNxdWV2Ni9QeUdpdGh1Yi9Gb29iYXIudHh0J30sCiAgICAgICAgeydhY2wnOiAncHVibGljLXJlYWQnfSwKICAgICAgICB7J3N1Y2Nlc3NfYWN0aW9uX3N0YXR1cyc6ICcyMDEnfSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRGaWxlbmFtZScsICcnXSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRDb250ZW50LVR5cGUnLCAnJ10KICAgIF0KfQ==","s3_url":"https://github.s3.amazonaws.com/","html_url":"https://github.com/downloads/jacquev6/PyGithub/Foobar.txt","mime_type":"text/richtext","size":1024,"url":"https://api.github.com/repos/jacquev6/PyGithub/downloads/242556","download_count":0,"name":"Foobar.txt","prefix":"downloads/jacquev6/PyGithub","path":"downloads/jacquev6/PyGithub/Foobar.txt","id":242556,"signature":"8FCU/4rgT3ohXfE9N6HO7JgbuK4=","created_at":"2012-05-22T19:11:49Z"} - diff --git a/github/tests/ReplayData/Repository.testCreateDownloadWithMinimalArguments.txt b/github/tests/ReplayData/Repository.testCreateDownloadWithMinimalArguments.txt deleted file mode 100644 index 618e7cc3..00000000 --- a/github/tests/ReplayData/Repository.testCreateDownloadWithMinimalArguments.txt +++ /dev/null @@ -1,11 +0,0 @@ -https -POST -api.github.com -None -/repos/jacquev6/PyGithub/downloads -{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'} -{"name": "Foobar.txt", "size": 1024} -201 -[('status', '201 Created'), ('x-ratelimit-remaining', '4954'), ('content-length', '1140'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"14a91323a46cfdfd53dfacffa96ab6a0"'), ('date', 'Tue, 22 May 2012 19:15:29 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/downloads/242562')] -{"accesskeyid":"1DWESVTPGHQVTX38V182","bucket":"github","content_type":"text/plain","download_count":0,"redirect":false,"mime_type":"text/plain","prefix":"downloads/jacquev6/PyGithub","expirationdate":"2112-05-22T19:15:29.000Z","url":"https://api.github.com/repos/jacquev6/PyGithub/downloads/242562","x-amz-meta-content-disposition":"attachment; filename=Foobar.txt","acl":"public-read","s3_url":"https://github.s3.amazonaws.com/","policy":"ewogICAgJ2V4cGlyYXRpb24nOiAnMjExMi0wNS0yMlQxOToxNToyOS4wMDBaJywKICAgICdjb25kaXRpb25zJzogWwogICAgICAgIHsnYnVja2V0JzogJ2dpdGh1Yid9LAogICAgICAgIHsna2V5JzogJ2Rvd25sb2Fkcy9qYWNxdWV2Ni9QeUdpdGh1Yi9Gb29iYXIudHh0J30sCiAgICAgICAgeydhY2wnOiAncHVibGljLXJlYWQnfSwKICAgICAgICB7J3N1Y2Nlc3NfYWN0aW9uX3N0YXR1cyc6ICcyMDEnfSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRGaWxlbmFtZScsICcnXSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRDb250ZW50LVR5cGUnLCAnJ10KICAgIF0KfQ==","size":1024,"signature":"Z2VR9HhhJdWkmhyoSZF+TT6hqIs=","name":"Foobar.txt","path":"downloads/jacquev6/PyGithub/Foobar.txt","created_at":"2012-05-22T19:15:29Z","description":null,"html_url":"https://github.com/downloads/jacquev6/PyGithub/Foobar.txt","id":242562} - diff --git a/github/tests/Repository.py b/github/tests/Repository.py index ff696f62..e68ad3e6 100644 --- a/github/tests/Repository.py +++ b/github/tests/Repository.py @@ -129,33 +129,6 @@ class Repository(Framework.TestCase): self.assertTrue(hook.active) # WTF self.assertEqual(hook.id, 257993) - def testCreateDownloadWithMinimalArguments(self): - download = self.repo.create_download("Foobar.txt", 1024) - self.assertEqual(download.id, 242562) - - def testCreateDownloadWithAllArguments(self): - download = self.repo.create_download("Foobar.txt", 1024, "Download created by PyGithub", "text/richtext") - self.assertEqual(download.accesskeyid, "1DWESVTPGHQVTX38V182") - self.assertEqual(download.acl, "public-read") - self.assertEqual(download.bucket, "github") - self.assertEqual(download.content_type, "text/richtext") - self.assertEqual(download.created_at, datetime.datetime(2012, 5, 22, 19, 11, 49)) - self.assertEqual(download.description, "Download created by PyGithub") - self.assertEqual(download.download_count, 0) - self.assertEqual(download.expirationdate, datetime.datetime(2112, 5, 22, 19, 11, 49)) - self.assertEqual(download.html_url, "https://github.com/downloads/jacquev6/PyGithub/Foobar.txt") - self.assertEqual(download.id, 242556) - self.assertEqual(download.mime_type, "text/richtext") - self.assertEqual(download.name, "Foobar.txt") - self.assertEqual(download.path, "downloads/jacquev6/PyGithub/Foobar.txt") - self.assertEqual(download.policy, "ewogICAgJ2V4cGlyYXRpb24nOiAnMjExMi0wNS0yMlQxOToxMTo0OS4wMDBaJywKICAgICdjb25kaXRpb25zJzogWwogICAgICAgIHsnYnVja2V0JzogJ2dpdGh1Yid9LAogICAgICAgIHsna2V5JzogJ2Rvd25sb2Fkcy9qYWNxdWV2Ni9QeUdpdGh1Yi9Gb29iYXIudHh0J30sCiAgICAgICAgeydhY2wnOiAncHVibGljLXJlYWQnfSwKICAgICAgICB7J3N1Y2Nlc3NfYWN0aW9uX3N0YXR1cyc6ICcyMDEnfSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRGaWxlbmFtZScsICcnXSwKICAgICAgICBbJ3N0YXJ0cy13aXRoJywgJyRDb250ZW50LVR5cGUnLCAnJ10KICAgIF0KfQ==") - self.assertEqual(download.prefix, "downloads/jacquev6/PyGithub") - self.assertFalse(download.redirect) - self.assertEqual(download.s3_url, "https://github.s3.amazonaws.com/") - self.assertEqual(download.signature, "8FCU/4rgT3ohXfE9N6HO7JgbuK4=") - self.assertEqual(download.size, 1024) - self.assertEqual(download.url, "https://api.github.com/repos/jacquev6/PyGithub/downloads/242556") - def testCreateGitRef(self): ref = self.repo.create_git_ref("refs/heads/BranchCreatedByPyGithub", "4303c5b90e2216d927155e9609436ccb8984c495") self.assertEqual(ref.url, "https://api.github.com/repos/jacquev6/PyGithub/git/refs/heads/BranchCreatedByPyGithub")