comparison venv/lib/python2.7/site-packages/github/tests/Issue214.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 github
27
28 import Framework
29
30
31 class Issue214(Framework.TestCase): # https://github.com/jacquev6/PyGithub/issues/214
32 def setUp(self):
33 Framework.TestCase.setUp(self)
34 self.repo = self.g.get_user().get_repo("PyGithub")
35 self.issue = self.repo.get_issue(1)
36
37 def testAssignees(self):
38 self.assertTrue(self.repo.has_in_assignees('farrd'))
39 self.assertFalse(self.repo.has_in_assignees('fake'))
40
41 def testCollaborators(self):
42 self.assertTrue(self.repo.has_in_collaborators('farrd'))
43 self.assertFalse(self.repo.has_in_collaborators('fake'))
44
45 self.assertFalse(self.repo.has_in_collaborators('marcmenges'))
46 self.repo.add_to_collaborators('marcmenges')
47 self.assertTrue(self.repo.has_in_collaborators('marcmenges'))
48
49 self.repo.remove_from_collaborators('marcmenges')
50 self.assertFalse(self.repo.has_in_collaborators('marcmenges'))
51
52 def testEditIssue(self):
53 self.assertEqual(self.issue.assignee, None)
54
55 self.issue.edit(assignee='farrd')
56 self.assertEqual(self.issue.assignee.login, 'farrd')
57
58 self.issue.edit(assignee=None)
59 self.assertEqual(self.issue.assignee, None)
60
61 def testCreateIssue(self):
62 issue = self.repo.create_issue("Issue created by PyGithub", assignee='farrd')
63 self.assertEqual(issue.assignee.login, 'farrd')
64
65 def testGetIssues(self):
66 issues = self.repo.get_issues(assignee='farrd')
67
68 for issue in issues:
69 self.assertEqual(issue.assignee.login, 'farrd')