Add additional test
This commit is contained in:
parent
c560de4111
commit
5272ec85ea
@ -115,6 +115,28 @@ def test_main_operational_exception(mocker, default_conf, caplog) -> None:
|
|||||||
assert log_has('Oh snap!', caplog)
|
assert log_has('Oh snap!', caplog)
|
||||||
|
|
||||||
|
|
||||||
|
def test_main_operational_exception1(mocker, default_conf, caplog) -> None:
|
||||||
|
patch_exchange(mocker)
|
||||||
|
mocker.patch(
|
||||||
|
'freqtrade.commands.list_commands.available_exchanges',
|
||||||
|
MagicMock(side_effect=ValueError('Oh snap!'))
|
||||||
|
)
|
||||||
|
patched_configuration_load_config_file(mocker, default_conf)
|
||||||
|
|
||||||
|
args = ['list-exchanges']
|
||||||
|
|
||||||
|
# Test Main + the KeyboardInterrupt exception
|
||||||
|
with pytest.raises(SystemExit):
|
||||||
|
main(args)
|
||||||
|
|
||||||
|
assert log_has('Fatal exception!', caplog)
|
||||||
|
assert not log_has_re(r'SIGINT.*', caplog)
|
||||||
|
mocker.patch(
|
||||||
|
'freqtrade.commands.list_commands.available_exchanges',
|
||||||
|
MagicMock(side_effect=KeyboardInterrupt)
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
def test_main_reload_conf(mocker, default_conf, caplog) -> None:
|
def test_main_reload_conf(mocker, default_conf, caplog) -> None:
|
||||||
patch_exchange(mocker)
|
patch_exchange(mocker)
|
||||||
mocker.patch('freqtrade.freqtradebot.FreqtradeBot.cleanup', MagicMock())
|
mocker.patch('freqtrade.freqtradebot.FreqtradeBot.cleanup', MagicMock())
|
||||||
|
Loading…
Reference in New Issue
Block a user