From cc775229d322b454788dabbe0e2af489a7fed4d0 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Thu, 28 Jun 2012 20:50:53 +0100 Subject: [PATCH] Add (failing) integration tests for issue #50 (labels with spaces in name) --- test/IntegrationTest.py | 1 + test/Issue50.py | 56 +++++++++++++++++++ test/ReplayData/Issue50.setUp.txt | 15 +++++ .../Issue50.testAddLabelToIssue.txt | 10 ++++ .../Issue50.testCreateIssueWithLabel.txt | 10 ++++ test/ReplayData/Issue50.testCreateLabel.txt | 5 ++ .../Issue50.testGetIssuesWithLabel.txt | 10 ++++ test/ReplayData/Issue50.testGetLabel.txt | 5 ++ test/ReplayData/Issue50.testGetLabels.txt | 5 ++ .../ReplayData/Issue50.testIssueGetLabels.txt | 5 ++ .../Issue50.testRemoveLabelFromIssue.txt | 10 ++++ .../ReplayData/Issue50.testSetIssueLabels.txt | 20 +++++++ 12 files changed, 152 insertions(+) create mode 100644 test/Issue50.py create mode 100644 test/ReplayData/Issue50.setUp.txt create mode 100644 test/ReplayData/Issue50.testAddLabelToIssue.txt create mode 100644 test/ReplayData/Issue50.testCreateIssueWithLabel.txt create mode 100644 test/ReplayData/Issue50.testCreateLabel.txt create mode 100644 test/ReplayData/Issue50.testGetIssuesWithLabel.txt create mode 100644 test/ReplayData/Issue50.testGetLabel.txt create mode 100644 test/ReplayData/Issue50.testGetLabels.txt create mode 100644 test/ReplayData/Issue50.testIssueGetLabels.txt create mode 100644 test/ReplayData/Issue50.testRemoveLabelFromIssue.txt create mode 100644 test/ReplayData/Issue50.testSetIssueLabels.txt diff --git a/test/IntegrationTest.py b/test/IntegrationTest.py index 86a98b44..a2d966b6 100755 --- a/test/IntegrationTest.py +++ b/test/IntegrationTest.py @@ -51,6 +51,7 @@ from UserKey import * from PaginatedList import * from Issue33 import * +from Issue50 import * from Exceptions import * Framework.main() diff --git a/test/Issue50.py b/test/Issue50.py new file mode 100644 index 00000000..2b50eac5 --- /dev/null +++ b/test/Issue50.py @@ -0,0 +1,56 @@ +# Copyright 2012 Vincent Jacques +# vincent@vincent-jacques.net + +# This file is part of PyGithub. http://vincent-jacques.net/PyGithub + +# PyGithub is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License +# as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + +# PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. + +# You should have received a copy of the GNU Lesser General Public License along with PyGithub. If not, see . + +import github + +import Framework + +class Issue50( Framework.TestCase ): # https://github.com/jacquev6/PyGithub/issues/50 + def setUp( self ): + Framework.TestCase.setUp( self ) + self.repo = self.g.get_user().get_repo( "PyGithub" ) + self.issue = self.repo.get_issue( 50 ) + self.labelName = "Label with spaces and strange characters (&*#$)" + + def testCreateLabel( self ): + label = self.repo.create_label( self.labelName, "ffff00" ) + self.assertEqual( label.name, self.labelName ) + + def testGetLabel( self ): + label = self.repo.get_label( self.labelName ) + self.assertEqual( label.name, self.labelName ) + + def testGetLabels( self ): + self.assertListKeyEqual( self.repo.get_labels(), lambda l: l.name, [ "Refactoring", "Public interface", "Functionalities", "Project management", "Bug", "Question", "RequestedByUser", self.labelName ] ) + + def testAddLabelToIssue( self ): + self.issue.add_to_labels( self.repo.get_label( self.labelName ) ) + + def testRemoveLabelFromIssue( self ): + self.issue.remove_from_labels( self.repo.get_label( self.labelName ) ) + + def testSetIssueLabels( self ): + self.issue.set_labels( self.repo.get_label( "Bug" ), self.repo.get_label( "RequestedByUser" ), self.repo.get_label( self.labelName ) ) + + def testIssueLabels( self ): + self.assertListKeyEqual( self.issue.labels, lambda l: l.name, [ "Bug", "RequestedByUser", self.labelName ] ) + + def testIssueGetLabels( self ): + self.assertListKeyEqual( self.issue.get_labels(), lambda l: l.name, [ "Bug", "RequestedByUser", self.labelName ] ) + + def testGetIssuesWithLabel( self ): + self.assertListKeyEqual( self.repo.get_issues( labels = [ self.repo.get_label( self.labelName ) ] ), lambda i: i.number, [ 50 ] ) + + def testCreateIssueWithLabel( self ): + issue = self.repo.create_issue( "Issue created by PyGithub to test issue #50", labels = [ self.repo.get_label( self.labelName ) ] ) + self.assertListKeyEqual( issue.labels, lambda l: l.name, [ self.labelName ] ) diff --git a/test/ReplayData/Issue50.setUp.txt b/test/ReplayData/Issue50.setUp.txt new file mode 100644 index 00000000..1b3bfab7 --- /dev/null +++ b/test/ReplayData/Issue50.setUp.txt @@ -0,0 +1,15 @@ +GET /user {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('content-length', '801'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4926'), ('server', 'nginx/1.0.13'), ('last-modified', 'Fri, 15 Jun 2012 15:37:06 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"41ade9c2e4794dd5214bb5f497af92cb"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:49:48 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"type":"User","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","total_private_repos":5,"company":"Criteo","login":"jacquev6","owned_private_repos":5,"plan":{"space":614400,"private_repos":5,"collaborators":1,"name":"micro"},"following":24,"blog":"http://vincent-jacques.net","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","public_repos":11,"public_gists":3,"followers":13,"email":"vincent@vincent-jacques.net","private_gists":5,"created_at":"2010-07-09T06:10:06Z","disk_usage":16820,"collaborators":0,"html_url":"https://github.com/jacquev6","name":"Vincent Jacques","location":"Paris, France","hireable":false,"url":"https://api.github.com/users/jacquev6","id":327146,"bio":""} + +GET /repos/jacquev6/PyGithub {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('content-length', '1154'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4925'), ('server', 'nginx/1.0.13'), ('last-modified', 'Tue, 26 Jun 2012 12:30:06 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"eb3fdb98c65995892b016162b91ad68c"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:49:49 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"git_url":"git://github.com/jacquev6/PyGithub.git","homepage":"http://vincent-jacques.net/PyGithub","owner":{"login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/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"},"open_issues":11,"permissions":{"push":true,"admin":true,"pull":true},"description":"Python library implementing the full Github API v3","master_branch":"master","has_issues":true,"svn_url":"https://github.com/jacquev6/PyGithub","full_name":"jacquev6/PyGithub","mirror_url":null,"has_downloads":true,"size":184,"fork":false,"created_at":"2012-02-25T12:53:47Z","html_url":"https://github.com/jacquev6/PyGithub","name":"PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","language":"Python","clone_url":"https://github.com/jacquev6/PyGithub.git","private":false,"pushed_at":"2012-06-20T21:03:27Z","id":3544490,"forks":5,"has_wiki":false,"watchers":29,"ssh_url":"git@github.com:jacquev6/PyGithub.git","updated_at":"2012-06-26T12:30:06Z"} + +GET /repos/jacquev6/PyGithub/issues/50 {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4924'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '1971'), ('server', 'nginx/1.0.13'), ('last-modified', 'Wed, 27 Jun 2012 22:46:10 GMT'), ('connection', 'keep-alive'), ('etag', '"bb61450865a934ca7ee53d6dde588876"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:49:49 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"labels":[{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"}],"body":null,"state":"open","closed_at":null,"assignee":{"login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/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},"comments":2,"title":"[Issue] Replace label _identity with name","created_at":"2012-06-25T18:45:05Z","number":50,"milestone":{"open_issues":3,"state":"open","due_on":"2012-07-01T07:00:00Z","description":"","creator":{"login":"jacquev6","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","url":"https://api.github.com/users/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},"closed_issues":0,"title":"Version 1.2","created_at":"2012-06-25T19:31:02Z","number":6,"url":"https://api.github.com/repos/jacquev6/PyGithub/milestones/6","id":136827},"html_url":"https://github.com/jacquev6/PyGithub/issues/50","url":"https://api.github.com/repos/jacquev6/PyGithub/issues/50","closed_by":null,"user":{"login":"philipkimmey","gravatar_id":"6baf93a46e584369e1ea64bc1aca62f4","url":"https://api.github.com/users/philipkimmey","avatar_url":"https://secure.gravatar.com/avatar/6baf93a46e584369e1ea64bc1aca62f4?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","id":211079},"id":5256315,"pull_request":{"patch_url":"https://github.com/jacquev6/PyGithub/pull/50.patch","diff_url":"https://github.com/jacquev6/PyGithub/pull/50.diff","html_url":"https://github.com/jacquev6/PyGithub/pull/50"},"updated_at":"2012-06-25T19:33:48Z"} + diff --git a/test/ReplayData/Issue50.testAddLabelToIssue.txt b/test/ReplayData/Issue50.testAddLabelToIssue.txt new file mode 100644 index 00000000..96b8f53b --- /dev/null +++ b/test/ReplayData/Issue50.testAddLabelToIssue.txt @@ -0,0 +1,10 @@ +GET /repos/jacquev6/PyGithub/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4949'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '197'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:38:12 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"} + +POST /repos/jacquev6/PyGithub/issues/50/labels {'Authorization': 'Basic login_and_password_removed'} ["Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29"] +422 +[('status', '422 Unprocessable Entity'), ('x-ratelimit-remaining', '4948'), ('content-length', '179'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('cache-control', ''), ('date', 'Thu, 28 Jun 2012 19:38:13 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"errors":[{"field":"name","resource":"Label","value":["Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29"],"code":"missing"}],"message":"Validation Failed"} + diff --git a/test/ReplayData/Issue50.testCreateIssueWithLabel.txt b/test/ReplayData/Issue50.testCreateIssueWithLabel.txt new file mode 100644 index 00000000..64416fac --- /dev/null +++ b/test/ReplayData/Issue50.testCreateIssueWithLabel.txt @@ -0,0 +1,10 @@ +GET /repos/jacquev6/PyGithub/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('content-length', '197'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4923'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:49:50 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"} + +POST /repos/jacquev6/PyGithub/issues {'Authorization': 'Basic login_and_password_removed'} {"labels": ["Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29"], "title": "Issue created by PyGithub to test issue #50"} +422 +[('status', '422 Unprocessable Entity'), ('content-length', '179'), ('x-ratelimit-remaining', '4922'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('cache-control', ''), ('date', 'Thu, 28 Jun 2012 19:49:51 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"errors":[{"field":"name","resource":"Label","value":["Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29"],"code":"missing"}],"message":"Validation Failed"} + diff --git a/test/ReplayData/Issue50.testCreateLabel.txt b/test/ReplayData/Issue50.testCreateLabel.txt new file mode 100644 index 00000000..f153d209 --- /dev/null +++ b/test/ReplayData/Issue50.testCreateLabel.txt @@ -0,0 +1,5 @@ +POST /repos/jacquev6/PyGithub/labels {'Authorization': 'Basic login_and_password_removed'} {"color": "ffff00", "name": "Label with spaces and strange characters (&*#$)"} +201 +[('status', '201 Created'), ('content-length', '197'), ('etag', '"99cbb3bf0f7ee7d6278c2ddd3ef42577"'), ('x-ratelimit-remaining', '4968'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"} + diff --git a/test/ReplayData/Issue50.testGetIssuesWithLabel.txt b/test/ReplayData/Issue50.testGetIssuesWithLabel.txt new file mode 100644 index 00000000..10f7c4bd --- /dev/null +++ b/test/ReplayData/Issue50.testGetIssuesWithLabel.txt @@ -0,0 +1,10 @@ +GET /repos/jacquev6/PyGithub/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4928'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('content-length', '197'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:48:05 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"} + +GET /repos/jacquev6/PyGithub/issues?labels=Label%2520with%2520spaces%2520and%2520strange%2520characters%2520%2528%2526%252A%2523%2524%2529 {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('content-length', '2'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4927'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"d751713988987e9331980363e24189ce"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 19:48:05 GMT'), ('content-type', 'application/json; charset=utf-8')] +[] + diff --git a/test/ReplayData/Issue50.testGetLabel.txt b/test/ReplayData/Issue50.testGetLabel.txt new file mode 100644 index 00000000..f90001c9 --- /dev/null +++ b/test/ReplayData/Issue50.testGetLabel.txt @@ -0,0 +1,5 @@ +GET /repos/jacquev6/PyGithub/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('content-length', '197'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4964'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:32:14 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"} + diff --git a/test/ReplayData/Issue50.testGetLabels.txt b/test/ReplayData/Issue50.testGetLabels.txt new file mode 100644 index 00000000..79208a00 --- /dev/null +++ b/test/ReplayData/Issue50.testGetLabels.txt @@ -0,0 +1,5 @@ +GET /repos/jacquev6/PyGithub/labels {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('content-length', '1015'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4953'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:36:59 GMT'), ('content-type', 'application/json; charset=utf-8')] +[{"color":"0b02e1","name":"Refactoring","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Refactoring"},{"color":"d7e102","name":"Public interface","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Public+interface"},{"color":"e102d8","name":"Functionalities","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Functionalities"},{"color":"444444","name":"Project management","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Project+management"},{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"02e10c","name":"Question","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Question"},{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"},{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"}] + diff --git a/test/ReplayData/Issue50.testIssueGetLabels.txt b/test/ReplayData/Issue50.testIssueGetLabels.txt new file mode 100644 index 00000000..0b6b4a57 --- /dev/null +++ b/test/ReplayData/Issue50.testIssueGetLabels.txt @@ -0,0 +1,5 @@ +GET /repos/jacquev6/PyGithub/issues/50/labels {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('content-length', '221'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4932'), ('server', 'nginx/1.0.13'), ('last-modified', 'Wed, 27 Jun 2012 22:46:10 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"bb61450865a934ca7ee53d6dde588876"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:46:04 GMT'), ('content-type', 'application/json; charset=utf-8')] +[{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"}] + diff --git a/test/ReplayData/Issue50.testRemoveLabelFromIssue.txt b/test/ReplayData/Issue50.testRemoveLabelFromIssue.txt new file mode 100644 index 00000000..41914303 --- /dev/null +++ b/test/ReplayData/Issue50.testRemoveLabelFromIssue.txt @@ -0,0 +1,10 @@ +GET /repos/jacquev6/PyGithub/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('content-length', '197'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4937'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:43:02 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"} + +DELETE /repos/jacquev6/PyGithub/issues/50/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('content-length', '221'), ('x-ratelimit-limit', '5000'), ('x-ratelimit-remaining', '4936'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('etag', '"f52869e02750b4a36166ec2d23c2f471"'), ('cache-control', 'max-age=0, private, must-revalidate'), ('date', 'Thu, 28 Jun 2012 19:43:02 GMT'), ('content-type', 'application/json; charset=utf-8')] +[{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"},{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"}] + diff --git a/test/ReplayData/Issue50.testSetIssueLabels.txt b/test/ReplayData/Issue50.testSetIssueLabels.txt new file mode 100644 index 00000000..39e07c6a --- /dev/null +++ b/test/ReplayData/Issue50.testSetIssueLabels.txt @@ -0,0 +1,20 @@ +GET /repos/jacquev6/PyGithub/labels/Bug {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('content-length', '97'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4944'), ('server', 'nginx/1.0.13'), ('last-modified', 'Sat, 20 Oct 2007 11:24:19 GMT'), ('connection', 'keep-alive'), ('etag', '"147027ac86c95043e935b318f88c3683"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:40:43 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"color":"e10c02","name":"Bug","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Bug"} + +GET /repos/jacquev6/PyGithub/labels/RequestedByUser {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('content-length', '121'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4943'), ('server', 'nginx/1.0.13'), ('last-modified', 'Sat, 20 Oct 2007 11:24:19 GMT'), ('connection', 'keep-alive'), ('etag', '"147027ac86c95043e935b318f88c3683"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:40:44 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"color":"e10c02","name":"RequestedByUser","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/RequestedByUser"} + +GET /repos/jacquev6/PyGithub/labels/Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29 {'Authorization': 'Basic login_and_password_removed'} null +200 +[('status', '200 OK'), ('content-length', '197'), ('x-ratelimit-limit', '5000'), ('vary', 'Accept, Authorization, Cookie'), ('x-ratelimit-remaining', '4942'), ('server', 'nginx/1.0.13'), ('last-modified', 'Thu, 28 Jun 2012 19:29:52 GMT'), ('connection', 'keep-alive'), ('etag', '"c536d81e7479c8c9acfa7deeddeb6e72"'), ('cache-control', 'private, max-age=60'), ('date', 'Thu, 28 Jun 2012 19:40:45 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"color":"ffff00","name":"Label with spaces and strange characters (&*#$)","url":"https://api.github.com/repos/jacquev6/PyGithub/labels/Label+with+spaces+and+strange+characters+%28%26%2A%23%24%29"} + +PUT /repos/jacquev6/PyGithub/issues/50/labels {'Authorization': 'Basic login_and_password_removed'} ["Bug", "RequestedByUser", "Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29"] +422 +[('status', '422 Unprocessable Entity'), ('content-length', '179'), ('x-ratelimit-remaining', '4941'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('cache-control', ''), ('date', 'Thu, 28 Jun 2012 19:40:45 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"errors":[{"field":"name","resource":"Label","value":["Label%20with%20spaces%20and%20strange%20characters%20%28%26%2A%23%24%29"],"code":"missing"}],"message":"Validation Failed"} +