Tests adjusted
This commit is contained in:
parent
d1fa5f307b
commit
f6a88c6e9b
@ -506,7 +506,8 @@ def test_check_exchange(default_conf, caplog) -> None:
|
|||||||
# Test an available exchange, supported by ccxt
|
# Test an available exchange, supported by ccxt
|
||||||
default_conf.get('exchange').update({'name': 'huobipro'})
|
default_conf.get('exchange').update({'name': 'huobipro'})
|
||||||
assert check_exchange(default_conf)
|
assert check_exchange(default_conf)
|
||||||
assert log_has_re(r"Exchange .* is supported by ccxt and .* not officially supported "
|
assert log_has_re(r"Exchange .* is known to the the ccxt library, available for the bot, "
|
||||||
|
r"but not officially supported "
|
||||||
r"by the Freqtrade development team\. .*", caplog)
|
r"by the Freqtrade development team\. .*", caplog)
|
||||||
caplog.clear()
|
caplog.clear()
|
||||||
|
|
||||||
@ -520,16 +521,16 @@ def test_check_exchange(default_conf, caplog) -> None:
|
|||||||
# Test a 'bad' exchange with check_for_bad=False
|
# Test a 'bad' exchange with check_for_bad=False
|
||||||
default_conf.get('exchange').update({'name': 'bitmex'})
|
default_conf.get('exchange').update({'name': 'bitmex'})
|
||||||
assert check_exchange(default_conf, False)
|
assert check_exchange(default_conf, False)
|
||||||
assert log_has_re(r"Exchange .* is supported by ccxt and .* not officially supported "
|
assert log_has_re(r"Exchange .* is known to the the ccxt library, available for the bot, "
|
||||||
|
r"but not officially supported "
|
||||||
r"by the Freqtrade development team\. .*", caplog)
|
r"by the Freqtrade development team\. .*", caplog)
|
||||||
caplog.clear()
|
caplog.clear()
|
||||||
|
|
||||||
# Test an invalid exchange
|
# Test an invalid exchange
|
||||||
default_conf.get('exchange').update({'name': 'unknown_exchange'})
|
default_conf.get('exchange').update({'name': 'unknown_exchange'})
|
||||||
|
|
||||||
with pytest.raises(
|
with pytest.raises(
|
||||||
OperationalException,
|
OperationalException,
|
||||||
match=r'.*Exchange "unknown_exchange" is not supported by ccxt '
|
match=r'Exchange "unknown_exchange" is not known to the ccxt library '
|
||||||
r'and therefore not available for the bot.*'
|
r'and therefore not available for the bot.*'
|
||||||
):
|
):
|
||||||
check_exchange(default_conf)
|
check_exchange(default_conf)
|
||||||
|
@ -31,7 +31,7 @@ def test_list_exchanges(capsys):
|
|||||||
|
|
||||||
start_list_exchanges(get_args(args))
|
start_list_exchanges(get_args(args))
|
||||||
captured = capsys.readouterr()
|
captured = capsys.readouterr()
|
||||||
assert re.match(r"Exchanges supported by ccxt and available.*", captured.out)
|
assert re.match(r"Exchanges available for Freqtrade.*", captured.out)
|
||||||
assert re.match(r".*binance,.*", captured.out)
|
assert re.match(r".*binance,.*", captured.out)
|
||||||
assert re.match(r".*bittrex,.*", captured.out)
|
assert re.match(r".*bittrex,.*", captured.out)
|
||||||
|
|
||||||
@ -43,10 +43,35 @@ def test_list_exchanges(capsys):
|
|||||||
|
|
||||||
start_list_exchanges(get_args(args))
|
start_list_exchanges(get_args(args))
|
||||||
captured = capsys.readouterr()
|
captured = capsys.readouterr()
|
||||||
assert not re.match(r"Exchanges supported by ccxt and available.*", captured.out)
|
|
||||||
assert re.search(r"^binance$", captured.out, re.MULTILINE)
|
assert re.search(r"^binance$", captured.out, re.MULTILINE)
|
||||||
assert re.search(r"^bittrex$", captured.out, re.MULTILINE)
|
assert re.search(r"^bittrex$", captured.out, re.MULTILINE)
|
||||||
|
|
||||||
|
# Test with --all
|
||||||
|
args = [
|
||||||
|
"list-exchanges",
|
||||||
|
"--all",
|
||||||
|
]
|
||||||
|
|
||||||
|
start_list_exchanges(get_args(args))
|
||||||
|
captured = capsys.readouterr()
|
||||||
|
assert re.match(r"All exchanges supported by the ccxt library.*", captured.out)
|
||||||
|
assert re.match(r".*binance,.*", captured.out)
|
||||||
|
assert re.match(r".*bittrex,.*", captured.out)
|
||||||
|
assert re.match(r".*bitmex,.*", captured.out)
|
||||||
|
|
||||||
|
# Test with --one-column --all
|
||||||
|
args = [
|
||||||
|
"list-exchanges",
|
||||||
|
"--one-column",
|
||||||
|
"--all",
|
||||||
|
]
|
||||||
|
|
||||||
|
start_list_exchanges(get_args(args))
|
||||||
|
captured = capsys.readouterr()
|
||||||
|
assert re.search(r"^binance$", captured.out, re.MULTILINE)
|
||||||
|
assert re.search(r"^bittrex$", captured.out, re.MULTILINE)
|
||||||
|
assert re.search(r"^bitmex$", captured.out, re.MULTILINE)
|
||||||
|
|
||||||
|
|
||||||
def test_create_datadir_failed(caplog):
|
def test_create_datadir_failed(caplog):
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user