class TestMimeType(TestCase):

    def setUp(self):
        self.ms = DummyService()

    def test_WITHOUT_mimetype(self, request_method):
        request_method.return_value = mock_response()
        self.ms.dummy_request()
        request_method.assert_called_with('get', _('dummyrequest'), params={})

    def test_WITH_mimetype(self, request_method):
        request_method.return_value = mock_response()
        self.ms.set_html()
        self.ms.dummy_request()
        request_method.assert_called_with('get', _('dummyrequest'),
            headers={'Accept': 'application/vnd.github.%s.html+json' %
                                MimeTypeMixin.VERSION},
            params={})
Exemple #2
0
class TestMimeType(TestCase):
    def setUp(self):
        self.ms = DummyService()

    def test_WITHOUT_mimetype(self, request_method):
        request_method.return_value = mock_response()
        self.ms.dummy_request()
        request_method.assert_called_with('get', _('dummyrequest'), params={})

    def test_WITH_mimetype(self, request_method):
        request_method.return_value = mock_response()
        self.ms.set_html()
        self.ms.dummy_request()
        request_method.assert_called_with(
            'get',
            _('dummyrequest'),
            headers={
                'Accept':
                'application/vnd.github.%s.html+json' % MimeTypeMixin.VERSION
            },
            params={})
 def setUp(self):
     self.ms = DummyService()
Exemple #4
0
 def setUp(self):
     self.ms = DummyService()