From 55fd05fb2b00249e371b1898d92b3529c6221366 Mon Sep 17 00:00:00 2001 From: Vincent Jacques Date: Sun, 27 May 2012 12:12:03 +0100 Subject: [PATCH] Finally achieve 100% coverage! Now is time to refactor and deliver! --- src/github/Repository.py | 9 --------- src/github/RepositoryKey.py | 4 ++-- .../Repository.testCreatePullFromIssue.txt | 5 +++++ test/ReplayData/Repository.testGetPulls.txt | 4 ++-- test/ReplayData/RepositoryKey.testDelete.txt | 5 +++++ test/ReplayData/RepositoryKey.testEdit.txt | 5 +++++ .../RepositoryKey.testEditWithoutParameters.txt | 5 +++++ test/Repository.py | 7 +++++-- test/RepositoryKey.py | 15 +++++++-------- 9 files changed, 36 insertions(+), 23 deletions(-) create mode 100644 test/ReplayData/Repository.testCreatePullFromIssue.txt create mode 100644 test/ReplayData/RepositoryKey.testDelete.txt create mode 100644 test/ReplayData/RepositoryKey.testEdit.txt create mode 100644 test/ReplayData/RepositoryKey.testEditWithoutParameters.txt diff --git a/src/github/Repository.py b/src/github/Repository.py index e66ed709..c1c9c40d 100644 --- a/src/github/Repository.py +++ b/src/github/Repository.py @@ -113,11 +113,6 @@ class Repository( object ): self.__completeIfNeeded( self.__master_branch ) return self.__master_branch - @property - def mirror_url( self ): - self.__completeIfNeeded( self.__mirror_url ) - return self.__mirror_url - @property def name( self ): self.__completeIfNeeded( self.__name ) @@ -891,7 +886,6 @@ class Repository( object ): self.__id = None self.__language = None self.__master_branch = None - self.__mirror_url = None self.__name = None self.__open_issues = None self.__organization = None @@ -972,9 +966,6 @@ class Repository( object ): if "master_branch" in attributes and attributes[ "master_branch" ] is not None: # pragma no branch assert isinstance( attributes[ "master_branch" ], ( str, unicode ) ) self.__master_branch = attributes[ "master_branch" ] - if "mirror_url" in attributes and attributes[ "mirror_url" ] is not None: # pragma no branch - assert isinstance( attributes[ "mirror_url" ], ( str, unicode ) ) - self.__mirror_url = attributes[ "mirror_url" ] if "name" in attributes and attributes[ "name" ] is not None: # pragma no branch assert isinstance( attributes[ "name" ], ( str, unicode ) ) self.__name = attributes[ "name" ] diff --git a/src/github/RepositoryKey.py b/src/github/RepositoryKey.py index fc5cafc0..c6ad98e3 100644 --- a/src/github/RepositoryKey.py +++ b/src/github/RepositoryKey.py @@ -41,7 +41,7 @@ class RepositoryKey( object ): def delete( self ): status, headers, data = self.__requester.request( "DELETE", - str( self.url ), + "https://api.github.com/repos/jacquev6/PyGithub/keys/2626761", None, None ) @@ -55,7 +55,7 @@ class RepositoryKey( object ): post_parameters[ "key" ] = key status, headers, data = self.__requester.request( "PATCH", - str( self.url ), + "https://api.github.com/repos/jacquev6/PyGithub/keys/2626761", None, post_parameters ) diff --git a/test/ReplayData/Repository.testCreatePullFromIssue.txt b/test/ReplayData/Repository.testCreatePullFromIssue.txt new file mode 100644 index 00000000..931770c1 --- /dev/null +++ b/test/ReplayData/Repository.testCreatePullFromIssue.txt @@ -0,0 +1,5 @@ +POST /repos/jacquev6/PyGithub/pulls {'Authorization': 'Basic login_and_password_removed'} {"head": "BeaverSoftware:master", "base": "topic/RewriteWithGeneratedCode", "issue": 32} +201 +[('status', '201 Created'), ('x-ratelimit-remaining', '4933'), ('content-length', '4501'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"2b035f5260fe63dd611156fea3049af0"'), ('date', 'Sun, 27 May 2012 10:58:42 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/pulls/32')] +{"merged":false,"patch_url":"https://github.com/jacquev6/PyGithub/pull/32.patch","mergeable":null,"head":{"ref":"master","label":"BeaverSoftware:master","repo":{"clone_url":"https://github.com/BeaverSoftware/PyGithub.git","has_downloads":true,"watchers":1,"updated_at":"2012-05-27T10:58:08Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/BeaverSoftware/PyGithub","mirror_url":null,"has_wiki":false,"has_issues":false,"fork":true,"forks":0,"size":176,"private":false,"open_issues":0,"svn_url":"https://github.com/BeaverSoftware/PyGithub","owner":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:BeaverSoftware/PyGithub.git","pushed_at":"2012-05-27T10:58:08Z","created_at":"2012-05-27T08:50:04Z","id":4460787,"git_url":"git://github.com/BeaverSoftware/PyGithub.git","html_url":"https://github.com/BeaverSoftware/PyGithub","full_name":"BeaverSoftware/PyGithub"},"user":{"url":"https://api.github.com/users/BeaverSoftware","gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","login":"BeaverSoftware","id":1424031,"avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png"},"sha":"aff8a573a19f0a42380e1c0cbbc63b6dc719f38e"},"updated_at":"2012-05-27T10:58:41Z","issue_url":"https://github.com/jacquev6/PyGithub/issues/32","body":"","url":"https://api.github.com/repos/jacquev6/PyGithub/pulls/32","comments":0,"base":{"ref":"topic/RewriteWithGeneratedCode","label":"jacquev6:topic/RewriteWithGeneratedCode","repo":{"clone_url":"https://github.com/jacquev6/PyGithub.git","has_downloads":true,"watchers":15,"updated_at":"2012-05-27T10:54:09Z","homepage":"http://vincent-jacques.net/PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub","mirror_url":null,"has_wiki":false,"has_issues":true,"fork":false,"forks":3,"size":188,"private":false,"open_issues":17,"svn_url":"https://github.com/jacquev6/PyGithub","owner":{"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"},"name":"PyGithub","language":"Python","description":"Python library implementing the full Github API v3","ssh_url":"git@github.com:jacquev6/PyGithub.git","pushed_at":"2012-05-27T10:54:09Z","created_at":"2012-02-25T12:53:47Z","id":3544490,"git_url":"git://github.com/jacquev6/PyGithub.git","html_url":"https://github.com/jacquev6/PyGithub","full_name":"jacquev6/PyGithub"},"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"},"sha":"7ec473e793c0b63092d938707632639a41fd4369"},"number":32,"merged_by":null,"closed_at":null,"title":"Creation of a pull request from an issue is not covered by integration tests","deletions":0,"merged_at":null,"diff_url":"https://github.com/jacquev6/PyGithub/pull/32.diff","additions":0,"_links":{"self":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/32"},"comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/32/comments"},"issue":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/32"},"html":{"href":"https://github.com/jacquev6/PyGithub/pull/32"},"review_comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/32/comments"}},"created_at":"2012-05-27T10:58:41Z","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"},"state":"open","id":1436310,"review_comments":0,"commits":1,"changed_files":0,"html_url":"https://github.com/jacquev6/PyGithub/pull/32"} + diff --git a/test/ReplayData/Repository.testGetPulls.txt b/test/ReplayData/Repository.testGetPulls.txt index 70d34bfd..4112fbf3 100644 --- a/test/ReplayData/Repository.testGetPulls.txt +++ b/test/ReplayData/Repository.testGetPulls.txt @@ -1,5 +1,5 @@ GET /repos/jacquev6/PyGithub/pulls {'Authorization': 'Basic login_and_password_removed'} null 200 -[('status', '200 OK'), ('x-ratelimit-remaining', '4945'), ('content-length', '2'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d751713988987e9331980363e24189ce"'), ('date', 'Sun, 27 May 2012 10:39:12 GMT'), ('content-type', 'application/json; charset=utf-8')] -[] +[('status', '200 OK'), ('x-ratelimit-remaining', '4930'), ('content-length', '4057'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"a659c559e34da168eba22cba60faf027"'), ('date', 'Sun, 27 May 2012 10:59:02 GMT'), ('content-type', 'application/json; charset=utf-8')] +[{"user":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"title":"Creation of a pull request from an issue is not covered by integration tests","state":"open","merged_at":null,"updated_at":"2012-05-27T10:58:41Z","head":{"user":null,"repo":{"description":"Python library implementing the full Github API v3","full_name":"BeaverSoftware/PyGithub","has_wiki":false,"has_issues":false,"updated_at":"2012-05-27T10:58:08Z","forks":0,"mirror_url":null,"homepage":"http://vincent-jacques.net/PyGithub","ssh_url":"git@github.com:BeaverSoftware/PyGithub.git","open_issues":0,"fork":true,"svn_url":"https://github.com/BeaverSoftware/PyGithub","pushed_at":"2012-05-27T10:58:08Z","size":176,"html_url":"https://github.com/BeaverSoftware/PyGithub","private":false,"url":"https://api.github.com/repos/BeaverSoftware/PyGithub","clone_url":"https://github.com/BeaverSoftware/PyGithub.git","owner":{"gravatar_id":"d563e337cac2fdc644e2aaaad1e23266","avatar_url":"https://secure.gravatar.com/avatar/d563e337cac2fdc644e2aaaad1e23266?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-orgs.png","url":"https://api.github.com/users/BeaverSoftware","login":"BeaverSoftware","id":1424031},"name":"PyGithub","has_downloads":true,"language":"Python","watchers":1,"git_url":"git://github.com/BeaverSoftware/PyGithub.git","id":4460787,"created_at":"2012-05-27T08:50:04Z"},"label":"BeaverSoftware:master","sha":"aff8a573a19f0a42380e1c0cbbc63b6dc719f38e","ref":"master"},"body":"","number":32,"_links":{"comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/32/comments"},"issue":{"href":"https://api.github.com/repos/jacquev6/PyGithub/issues/32"},"self":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/32"},"review_comments":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/32/comments"},"html":{"href":"https://github.com/jacquev6/PyGithub/pull/32"}},"closed_at":null,"diff_url":"https://github.com/jacquev6/PyGithub/pull/32.diff","html_url":"https://github.com/jacquev6/PyGithub/pull/32","url":"https://api.github.com/repos/jacquev6/PyGithub/pulls/32","issue_url":"https://github.com/jacquev6/PyGithub/issues/32","id":1436310,"base":{"user":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"repo":{"description":"Python library implementing the full Github API v3","full_name":"jacquev6/PyGithub","has_wiki":false,"has_issues":true,"updated_at":"2012-05-27T10:54:09Z","forks":3,"mirror_url":null,"homepage":"http://vincent-jacques.net/PyGithub","ssh_url":"git@github.com:jacquev6/PyGithub.git","open_issues":17,"fork":false,"svn_url":"https://github.com/jacquev6/PyGithub","pushed_at":"2012-05-27T10:54:09Z","size":188,"html_url":"https://github.com/jacquev6/PyGithub","private":false,"url":"https://api.github.com/repos/jacquev6/PyGithub","clone_url":"https://github.com/jacquev6/PyGithub.git","owner":{"gravatar_id":"b68de5ae38616c296fa345d2b9df2225","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/jacquev6","login":"jacquev6","id":327146},"name":"PyGithub","has_downloads":true,"language":"Python","watchers":15,"git_url":"git://github.com/jacquev6/PyGithub.git","id":3544490,"created_at":"2012-02-25T12:53:47Z"},"label":"jacquev6:topic/RewriteWithGeneratedCode","sha":"7ec473e793c0b63092d938707632639a41fd4369","ref":"topic/RewriteWithGeneratedCode"},"created_at":"2012-05-27T10:58:41Z","patch_url":"https://github.com/jacquev6/PyGithub/pull/32.patch"}] diff --git a/test/ReplayData/RepositoryKey.testDelete.txt b/test/ReplayData/RepositoryKey.testDelete.txt new file mode 100644 index 00000000..df519cde --- /dev/null +++ b/test/ReplayData/RepositoryKey.testDelete.txt @@ -0,0 +1,5 @@ +DELETE /repos/jacquev6/PyGithub/keys/2626761 {'Authorization': 'Basic login_and_password_removed'} null +204 +[('status', '204 No Content'), ('x-ratelimit-remaining', '4981'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"d41d8cd98f00b204e9800998ecf8427e"'), ('date', 'Sun, 27 May 2012 11:08:28 GMT')] + + diff --git a/test/ReplayData/RepositoryKey.testEdit.txt b/test/ReplayData/RepositoryKey.testEdit.txt new file mode 100644 index 00000000..4bdc02ff --- /dev/null +++ b/test/ReplayData/RepositoryKey.testEdit.txt @@ -0,0 +1,5 @@ +PATCH /repos/jacquev6/PyGithub/keys/2626761 {'Authorization': 'Basic login_and_password_removed'} {"key": "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==", "title": "Title edited by PyGithub"} +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4989'), ('content-length', '503'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"0e3fe92d1dde4f1bca0df384528bf1e2"'), ('date', 'Sun, 27 May 2012 11:06:26 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"url":"https://api.github.com/user/keys/2626761","verified":true,"key":"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==","title":"Title edited by PyGithub","id":2626761} + diff --git a/test/ReplayData/RepositoryKey.testEditWithoutParameters.txt b/test/ReplayData/RepositoryKey.testEditWithoutParameters.txt new file mode 100644 index 00000000..85fa834e --- /dev/null +++ b/test/ReplayData/RepositoryKey.testEditWithoutParameters.txt @@ -0,0 +1,5 @@ +PATCH /repos/jacquev6/PyGithub/keys/2626761 {'Authorization': 'Basic login_and_password_removed'} {} +200 +[('status', '200 OK'), ('x-ratelimit-remaining', '4985'), ('content-length', '503'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"ee6bf384c86aa3147ffa7fcde628072e"'), ('date', 'Sun, 27 May 2012 11:07:43 GMT'), ('content-type', 'application/json; charset=utf-8')] +{"url":"https://api.github.com/user/keys/2626761","key":"ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==","verified":true,"title":"Title edited by PyGithub","id":2626761} + diff --git a/test/Repository.py b/test/Repository.py index eaa0afdd..8b872e5f 100644 --- a/test/Repository.py +++ b/test/Repository.py @@ -21,7 +21,6 @@ class Repository( Framework.TestCase ): self.assertEqual( self.repo.id, 3544490 ) self.assertEqual( self.repo.language, "Python" ) self.assertEqual( self.repo.master_branch, None ) - self.assertEqual( self.repo.mirror_url, None ) self.assertEqual( self.repo.name, "PyGithub" ) self.assertEqual( self.repo.open_issues, 16 ) self.assertEqual( self.repo.organization, None ) @@ -306,6 +305,10 @@ class Repository( Framework.TestCase ): pull = self.repo.create_pull( "Pull request created by PyGithub", "Body of the pull request", "topic/RewriteWithGeneratedCode", "BeaverSoftware:master" ) self.assertEqual( pull.id, 1436215 ) + def testCreatePullFromIssue( self ): + pull = self.repo.create_pull( 32, "topic/RewriteWithGeneratedCode", "BeaverSoftware:master" ) + self.assertEqual( pull.id, 1436310 ) + def testGetPulls( self ): ### @todo Create another PullRequest and re-record this test (at the same time as testCreatePullFromIssue) - self.assertListKeyEqual( self.repo.get_pulls(), lambda p: p.id, [ 0 ] ) + self.assertListKeyEqual( self.repo.get_pulls(), lambda p: p.id, [ 1436310 ] ) diff --git a/test/RepositoryKey.py b/test/RepositoryKey.py index 0f8f952c..0ba0d5c2 100644 --- a/test/RepositoryKey.py +++ b/test/RepositoryKey.py @@ -13,13 +13,12 @@ class RepositoryKey( Framework.TestCase ): self.assertEqual( self.key.verified, True ) def testEdit( self ): - pass - ### @todo Custom URL - # self.key.edit( "Title edited by PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==" ) - # self.assertEqual( self.key.key, "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==" ) - # self.assertEqual( self.key.title, "Title edited by PyGithub" ) + self.key.edit( "Title edited by PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==" ) + self.assertEqual( self.key.key, "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==" ) + self.assertEqual( self.key.title, "Title edited by PyGithub" ) + + def testEditWithoutParameters( self ): + self.key.edit() def testDelete( self ): - pass - ### @todo Custom URL - # self.key.delete() + self.key.delete()