Issue823.py
1 ############################ Copyrights and license ############################ 2 # # 3 # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net> # 4 # Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net> # 5 # Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com> # 6 # Copyright 2018 sfdye <tsfdye@gmail.com> # 7 # # 8 # This file is part of PyGithub. # 9 # http://pygithub.readthedocs.io/ # 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 from . import Framework 27 28 29 class Issue823(Framework.TestCase): 30 def setUp(self): 31 super().setUp() 32 self.org = self.g.get_organization("p-society") 33 self.team = self.org.get_team(2745783) 34 self.pending_invitations = self.team.invitations() 35 36 def testGetPendingInvitationAttributes(self): 37 team_url = self.pending_invitations[0].invitation_teams_url 38 self.assertEqual( 39 team_url, 40 "https://api.github.com/organizations/29895434/invitations/6080804/teams", 41 ) 42 inviter = self.pending_invitations[0].inviter.login 43 self.assertEqual(inviter, "palash25") 44 role = self.pending_invitations[0].role 45 self.assertEqual(role, "direct_member") 46 team_count = self.pending_invitations[0].team_count 47 self.assertEqual(team_count, 1)