comparison venv/lib/python2.7/site-packages/github/tests/RepositoryKey.py @ 0:d67268158946 draft

planemo upload commit a3f181f5f126803c654b3a66dd4e83a48f7e203b
author bcclaywell
date Mon, 12 Oct 2015 17:43:33 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:d67268158946
1 # -*- coding: utf-8 -*-
2
3 # ########################## Copyrights and license ############################
4 # #
5 # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
6 # Copyright 2012 Zearin <zearin@gonk.net> #
7 # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> #
8 # #
9 # This file is part of PyGithub. http://jacquev6.github.com/PyGithub/ #
10 # #
11 # PyGithub is free software: you can redistribute it and/or modify it under #
12 # the terms of the GNU Lesser General Public License as published by the Free #
13 # Software Foundation, either version 3 of the License, or (at your option) #
14 # any later version. #
15 # #
16 # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY #
17 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS #
18 # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
19 # details. #
20 # #
21 # You should have received a copy of the GNU Lesser General Public License #
22 # along with PyGithub. If not, see <http://www.gnu.org/licenses/>. #
23 # #
24 # ##############################################################################
25
26 import Framework
27
28
29 class RepositoryKey(Framework.TestCase):
30 def setUp(self):
31 Framework.TestCase.setUp(self)
32 self.key = self.g.get_user().get_repo("PyGithub").get_key(2626761)
33
34 def testAttributes(self):
35 self.assertEqual(self.key.id, 2626761)
36 self.assertEqual(self.key.key, "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA2Mm0RjTNAYFfSCtUpO54usdseroUSIYg5KX4JoseTpqyiB/hqewjYLAdUq/tNIQzrkoEJWSyZrQt0ma7/YCyMYuNGd3DU6q6ZAyBeY3E9RyCiKjO3aTL2VKQGFvBVVmGdxGVSCITRphAcsKc/PF35/fg9XP9S0anMXcEFtdfMHz41SSw+XtE+Vc+6cX9FuI5qUfLGbkv8L1v3g4uw9VXlzq4GfTA+1S7D6mcoGHopAIXFlVr+2RfDKdSURMcB22z41fljO1MW4+zUS/4FyUTpL991es5fcwKXYoiE+x06VJeJJ1Krwx+DZj45uweV6cHXt2JwJEI9fWB6WyBlDejWw==")
37 self.assertEqual(self.key.title, "Key added through PyGithub")
38 self.assertEqual(self.key.url, "https://api.github.com/user/keys/2626761")
39 self.assertTrue(self.key.verified)
40
41 def testEdit(self):
42 self.key.edit("Title edited by PyGithub", "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==")
43 self.assertEqual(self.key.key, "ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA5Q58YmzZjU64prR5Pk91MfeHezOTgLqDYmepYbv3qjguiHtPai1vSai5WvUv3hgf9DArXsXE5CV6yoBIhAdGtpJKExHuQ2m4XTFCdbrgfQ3ypcSdgzEiQemyTA6TWwhbuwjJ1IqJMYOVLH+FBCkD8pyIpUDO7v3vaR2TCEuNwOS7lbsRsW3OkGYnUKjaPaCTe/inrqb7I3OE8cPhWJ3dM/zzzBj22J4LCNKhjKua8TFS74xGm3lNDZ6/twQl4n4xmrH/3tG+WOJicNO3JohNHqK9T0pILnr3epEyfdkBjcG0qXApqWvH2WipJhaH6of8Gdr0Z/K/7p8QFddmwNgdPQ==")
44 self.assertEqual(self.key.title, "Title edited by PyGithub")
45
46 def testEditWithoutParameters(self):
47 self.key.edit()
48
49 def testDelete(self):
50 self.key.delete()