/ tests / GitMembership.py
GitMembership.py
 1  ############################ Copyrights and license ############################
 2  #                                                                              #
 3  # Copyright 2012 Steve English <steve.english@navetas.com>                     #
 4  # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net>                 #
 5  # Copyright 2012 Zearin <zearin@gonk.net>                                      #
 6  # Copyright 2013 AKFish <akfish@gmail.com>                                     #
 7  # Copyright 2013 Cameron White <cawhite@pdx.edu>                               #
 8  # Copyright 2013 Vincent Jacques <vincent@vincent-jacques.net>                 #
 9  # Copyright 2013 poulp <mathieu.nerv@gmail.com>                                #
10  # Copyright 2014 Tomas Radej <tradej@redhat.com>                               #
11  # Copyright 2014 Vincent Jacques <vincent@vincent-jacques.net>                 #
12  # Copyright 2016 E. Dunham <github@edunham.net>                                #
13  # Copyright 2016 Jannis Gebauer <ja.geb@me.com>                                #
14  # Copyright 2016 Peter Buckley <dx-pbuckley@users.noreply.github.com>          #
15  # Copyright 2017 Balázs Rostás <rostas.balazs@gmail.com>                       #
16  # Copyright 2017 Jannis Gebauer <ja.geb@me.com>                                #
17  # Copyright 2017 Simon <spam@esemi.ru>                                         #
18  # Copyright 2018 Wan Liuyang <tsfdye@gmail.com>                                #
19  # Copyright 2018 bryanhuntesl <31992054+bryanhuntesl@users.noreply.github.com> #
20  # Copyright 2018 sfdye <tsfdye@gmail.com>                                      #
21  # Copyright 2018 itsbruce <it.is.bruce@gmail.com>                              #
22  #                                                                              #
23  # This file is part of PyGithub.                                               #
24  # http://pygithub.readthedocs.io/                                              #
25  #                                                                              #
26  # PyGithub is free software: you can redistribute it and/or modify it under    #
27  # the terms of the GNU Lesser General Public License as published by the Free  #
28  # Software Foundation, either version 3 of the License, or (at your option)    #
29  # any later version.                                                           #
30  #                                                                              #
31  # PyGithub is distributed in the hope that it will be useful, but WITHOUT ANY  #
32  # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS    #
33  # FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more #
34  # details.                                                                     #
35  #                                                                              #
36  # You should have received a copy of the GNU Lesser General Public License     #
37  # along with PyGithub. If not, see <http://www.gnu.org/licenses/>.             #
38  #                                                                              #
39  ################################################################################
40  
41  from . import Framework
42  
43  
44  class GitMembership(Framework.TestCase):
45      def testGetMembership(self):
46          octocat = self.g.get_user()
47          self.assertEqual(octocat.login, "octocat")
48          membership_data = octocat.get_organization_membership("github")
49          self.assertEqual(membership_data.user.login, "octocat")
50          self.assertEqual(membership_data.role, "admin")
51          self.assertEqual(membership_data.organization.login, "github")