def test_list_resource_with_parent(self, mock_request): parent = _Parent('parent', '1234', None) requestor = APIRequestor(self.client, self.resources, parent=parent) requestor.list_raw() mock_request.assert_called_once_with('/parent/1234/resources', 'GET', params=None)
def test_list_raw_uri_params_requestor_params(self, mock_request): params = {'param': 'value'} requestor = APIRequestor(self.client, self.resources, params=params) requestor.list_raw('/test_uri?') mock_request.assert_called_once_with('/test_uri?', 'GET', params=params)
def test_uuid_with_other_params(self, mock_make_call): self.client.uuid = True requestor = APIRequestor(self.client, self.resources) requestor.params = {'test': '1234'} requestor.list_raw() params_arg = mock_make_call.call_args[0][-1] self.assertEqual(params_arg['test'], '1234') self.assertTrue('uuid' in params_arg)
def test_uuid_not_set(self, mock_request): self.client.uuid = False requestor = APIRequestor(self.client, self.resources) requestor.params = {'test': '1234'} requestor.list_raw() mock_request.assert_called_once_with('/resources', 'GET', params={'test': '1234'})
def test_list_raw_uri_params_no_requestor_params(self, mock_request): requestor = APIRequestor(self.client, self.resources) requestor.list_raw('/test_uri?') mock_request.assert_called_once_with('/test_uri?', 'GET', params=None)
def test_list_resource(self, mock_request): requestor = APIRequestor(self.client, self.resources) requestor.list_raw() mock_request.assert_called_once_with('/resources', 'GET', params=None)
def test_uuid_set(self, mock_make_call): self.client.uuid = True requestor = APIRequestor(self.client, self.resources) requestor.list_raw() params_arg = mock_make_call.call_args[0][-1] self.assertTrue('uuid' in params_arg)
def test_list_resource_with_parent(self, mock_request): parent = ('parent', '1234', None) requestor = APIRequestor(self.client, self.resources, parent=parent) requestor.list_raw() mock_request.assert_called_once_with( '/parent/1234/resources', 'GET', params=None)