From 2df5c7682862b14928be38db95e6baccedde3e24 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Sat, 1 Dec 2018 16:13:15 -0500 Subject: [PATCH] Adjust cli tests for new quotes list output --- tests/test_cli.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/tests/test_cli.py b/tests/test_cli.py index 2273410a..ec46c004 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -18,11 +18,11 @@ def run(cmd, *args): return cp -def verify_keys(tickers, quotes_dict): +def verify_keys(tickers, quotes): """Verify all ticker names are keys in ``quotes_dict``. """ - for key, quote in quotes_dict.items(): - assert key in tickers + for quote in quotes: + assert quote['key'] in tickers @pytest.fixture @@ -39,8 +39,8 @@ def test_known_quotes(capfd, nyse_tickers): # verify output can be parsed as json out, err = capfd.readouterr() - quotes_dict = json.loads(out) - verify_keys(nyse_tickers, quotes_dict) + quotes = json.loads(out) + verify_keys(nyse_tickers, quotes) @pytest.mark.parametrize( @@ -61,8 +61,8 @@ def test_quotes_ticker_not_found( out, err = capfd.readouterr() if out: # verify output can be parsed as json - quotes_dict = json.loads(out) - verify_keys(tickers, quotes_dict) + quotes = json.loads(out) + verify_keys(tickers, quotes) # check for warning log message when some quotes are found warnmsg = f'Could not find symbol {bad_ticker[0]}' assert warnmsg in err