diff --git a/distilclient/tests/unit/v2/test_quotations.py b/distilclient/tests/unit/v2/test_quotations.py index c907868..dc51d60 100644 --- a/distilclient/tests/unit/v2/test_quotations.py +++ b/distilclient/tests/unit/v2/test_quotations.py @@ -33,14 +33,11 @@ class QuotationsTest(utils.TestCase): @mock.patch.object(base.Manager, '_list') def test_list_with_project_id(self, mock_list): - self.client.quotations.list('2017-1-1', '2018-2-1', - 'project_id') - mock_list.assert_called_with('/v2/quotations?start=2017-1-1' - '&end=2018-2-1&project_id=project_id', + self.client.quotations.list('project_id') + mock_list.assert_called_with('/v2/quotations?project_id=project_id', 'quotations') @mock.patch.object(base.Manager, '_list') def test_list_without_project_id(self, mock_list): - self.client.quotations.list('2017-1-1', '2018-2-1') - mock_list.assert_called_with('/v2/quotations?start=2017-1-1' - '&end=2018-2-1', 'quotations') + self.client.quotations.list() + mock_list.assert_called_with('/v2/quotations', 'quotations') diff --git a/distilclient/v2/quotations.py b/distilclient/v2/quotations.py index 7a0e60b..36a32b3 100644 --- a/distilclient/v2/quotations.py +++ b/distilclient/v2/quotations.py @@ -17,20 +17,15 @@ from distilclient import base class QuotationManager(base.Manager): - def list(self, start, end, project_id=None): + def list(self, project_id=None): """Retrieve a list of quotations. - :param start: Start date of the query - :param end: End date of the query :param project_id: Project ID, there there is no project id given, Distil will use the project ID from token. :returns: A list of quotations. """ - url = "/v2/quotations?start={0}&end={1}" + url = "/v2/quotations" if project_id: - url = url.format(start, end) + "&project_id=" + project_id - else: - url = url.format(start, end) - + url = url + "?project_id=" + project_id return self._list(url, "quotations")