From d8ff79a2faa69ac714d5898ca1b1386cf70afacf Mon Sep 17 00:00:00 2001 From: Matthias Date: Thu, 29 Oct 2020 07:54:42 +0100 Subject: [PATCH] Improve tests of list commands --- tests/commands/test_commands.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/commands/test_commands.py b/tests/commands/test_commands.py index 6861e0cd9..305b6b376 100644 --- a/tests/commands/test_commands.py +++ b/tests/commands/test_commands.py @@ -435,6 +435,16 @@ def test_list_markets(mocker, markets, capsys): assert re.search(r"^BLK/BTC$", captured.out, re.MULTILINE) assert re.search(r"^LTC/USD$", captured.out, re.MULTILINE) + mocker.patch('freqtrade.exchange.Exchange.markets', PropertyMock(side_effect=ValueError)) + # Test --one-column + args = [ + "list-markets", + '--config', 'config.json.example', + "--one-column" + ] + with pytest.raises(OperationalException, match=r"Cannot get markets.*"): + start_list_markets(get_args(args), False) + def test_create_datadir_failed(caplog): @@ -707,6 +717,7 @@ def test_start_list_strategies(mocker, caplog, capsys): "list-strategies", "--strategy-path", str(Path(__file__).parent.parent / "strategy" / "strats"), + '--no-color', ] pargs = get_args(args) # pargs['config'] = None