From 2a4c04a14f398c66a47a2a4e50f2516fc48d47ce Mon Sep 17 00:00:00 2001 From: Andrey Almabekov Date: Mon, 11 Feb 2019 11:41:48 -0400 Subject: [PATCH] Put text returned by mock requests in a single lines --- tests/test_resources.py | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/tests/test_resources.py b/tests/test_resources.py index 108dbc2..d6438b4 100644 --- a/tests/test_resources.py +++ b/tests/test_resources.py @@ -85,18 +85,12 @@ def test_get_results(self, reqmock): def test_unique_currencies(self, reqmock): # mock for the Exchange Rate table request reqmock.get('https://api/exchange_rate_tables/abc_id', - status_code=200, text='{"id":"abc_id"}') + status_code=200, text='{"id": "abc_id"}') fx_table = ExchangeRateTable.retrieve('abc_id') # mock for the currencies method call - reqmock.get('https://api/exchange_rate_tables/abc_id/currencies', status_code=200, - text='{' - '"currencies": ' - '[ ' - '{"code": "CAD"}, ' - '{"code": "EUR"} ' - ']' - '}') + reqmock.get('https://api/exchange_rate_tables/abc_id/currencies', + status_code=200, text='{"currencies": [{"code": "CAD"}, {"code": "EUR"}]}') curr = fx_table.currencies() assert hasattr(curr, 'currencies') assert len(curr.currencies) == 2 @@ -111,12 +105,8 @@ def test_unique_currencies_empty(self, reqmock): status_code=200, text='{"id":"abc_id"}') fx_table = ExchangeRateTable.retrieve('abc_id') - reqmock.get('https://api/exchange_rate_tables/abc_id/currencies', status_code=200, - text='{' - '"currencies": ' - '[ ' - ']' - '}') + reqmock.get('https://api/exchange_rate_tables/abc_id/currencies', + status_code=200, text='{"currencies": []}') curr = fx_table.currencies() assert hasattr(curr, 'currencies') assert len(curr.currencies) == 0