Exemple #1
0
 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)
Exemple #2
0
 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)
Exemple #3
0
 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)
Exemple #4
0
 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'})
Exemple #5
0
 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)
Exemple #6
0
 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)
Exemple #7
0
 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)
Exemple #8
0
 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)
Exemple #9
0
 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)
Exemple #10
0
 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'})
Exemple #11
0
 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)
Exemple #12
0
 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)