コード例 #1
0
ファイル: test_orgs.py プロジェクト: 5783354/python-github3
 def setUp(self):
     self.ms = Members()
コード例 #2
0
ファイル: test_orgs.py プロジェクト: tirimula/ITSP
 def setUp(self):
     self.ms = Members()
コード例 #3
0
ファイル: test_orgs.py プロジェクト: 5783354/python-github3
class TestMemberService(TestCase):
    def setUp(self):
        self.ms = Members()

    def test_LIST(self, request_method):
        request_method.return_value = mock_response_result()
        self.ms.list('acme').all()
        self.assertEqual(request_method.call_args[0],
                         ('get', _('orgs/acme/members')))

    def test_IS_MEMBER(self, request_method):
        request_method.return_value = mock_response()
        self.ms.is_member('acme', 'octocat')
        self.assertEqual(request_method.call_args[0],
                         ('head', _('orgs/acme/members/octocat')))

    def test_REMOVE_MEMBER(self, request_method):
        request_method.return_value = mock_response('delete')
        self.ms.remove_member('acme', 'octocat')
        self.assertEqual(request_method.call_args[0],
                         ('delete', _('orgs/acme/members/octocat')))

    def test_LIST_PUBLIC(self, request_method):
        request_method.return_value = mock_response_result()
        self.ms.list_public('acme').all()
        self.assertEqual(request_method.call_args[0],
                         ('get', _('orgs/acme/public_members')))

    def test_IS_PUBLIC_MEMBER(self, request_method):
        request_method.return_value = mock_response()
        self.ms.is_public_member('acme', 'octocat')
        self.assertEqual(request_method.call_args[0],
                         ('head', _('orgs/acme/public_members/octocat')))

    def test_PUBLICIZE_MEMBERSHIP(self, request_method):
        request_method.return_value = mock_response()
        self.ms.publicize_membership('acme', 'octocat')
        self.assertEqual(request_method.call_args[0],
                         ('put', _('orgs/acme/public_members/octocat')))

    def test_CONCEAL_MEMBERSHIP(self, request_method):
        request_method.return_value = mock_response('delete')
        self.ms.conceal_membership('acme', 'octocat')
        self.assertEqual(request_method.call_args[0],
                         ('delete', _('orgs/acme/public_members/octocat')))
コード例 #4
0
ファイル: test_orgs.py プロジェクト: tirimula/ITSP
class TestMemberService(TestCase):
    def setUp(self):
        self.ms = Members()

    def test_LIST(self, request_method):
        request_method.return_value = mock_response_result()
        self.ms.list('acme').all()
        self.assertEqual(request_method.call_args[0],
                         ('get', _('orgs/acme/members')))

    def test_IS_MEMBER(self, request_method):
        request_method.return_value = mock_response()
        self.ms.is_member('acme', 'octocat')
        self.assertEqual(request_method.call_args[0],
                         ('head', _('orgs/acme/members/octocat')))

    def test_REMOVE_MEMBER(self, request_method):
        request_method.return_value = mock_response('delete')
        self.ms.remove_member('acme', 'octocat')
        self.assertEqual(request_method.call_args[0],
                         ('delete', _('orgs/acme/members/octocat')))

    def test_LIST_PUBLIC(self, request_method):
        request_method.return_value = mock_response_result()
        self.ms.list_public('acme').all()
        self.assertEqual(request_method.call_args[0],
                         ('get', _('orgs/acme/public_members')))

    def test_IS_PUBLIC_MEMBER(self, request_method):
        request_method.return_value = mock_response()
        self.ms.is_public_member('acme', 'octocat')
        self.assertEqual(request_method.call_args[0],
                         ('head', _('orgs/acme/public_members/octocat')))

    def test_PUBLICIZE_MEMBERSHIP(self, request_method):
        request_method.return_value = mock_response()
        self.ms.publicize_membership('acme', 'octocat')
        self.assertEqual(request_method.call_args[0],
                         ('put', _('orgs/acme/public_members/octocat')))

    def test_CONCEAL_MEMBERSHIP(self, request_method):
        request_method.return_value = mock_response('delete')
        self.ms.conceal_membership('acme', 'octocat')
        self.assertEqual(request_method.call_args[0],
                         ('delete', _('orgs/acme/public_members/octocat')))