mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 18:23:55 +00:00
Update tests to test both balance versions
This commit is contained in:
parent
98681b78b4
commit
6643b83afe
|
@ -559,10 +559,32 @@ def test_balance_handle_empty_response(default_conf, update, mocker) -> None:
|
|||
|
||||
telegram = Telegram(freqtradebot)
|
||||
|
||||
freqtradebot.config['dry_run'] = False
|
||||
telegram._balance(bot=MagicMock(), update=update)
|
||||
result = msg_mock.call_args_list[0][0][0]
|
||||
assert msg_mock.call_count == 1
|
||||
assert 'all balances are zero' in result
|
||||
assert 'All balances are zero.' in result
|
||||
|
||||
|
||||
def test_balance_handle_empty_response_dry(default_conf, update, mocker) -> None:
|
||||
mocker.patch('freqtrade.exchange.Exchange.get_balances', return_value={})
|
||||
|
||||
msg_mock = MagicMock()
|
||||
mocker.patch.multiple(
|
||||
'freqtrade.rpc.telegram.Telegram',
|
||||
_init=MagicMock(),
|
||||
_send_msg=msg_mock
|
||||
)
|
||||
|
||||
freqtradebot = get_patched_freqtradebot(mocker, default_conf)
|
||||
patch_get_signal(freqtradebot, (True, False))
|
||||
|
||||
telegram = Telegram(freqtradebot)
|
||||
|
||||
telegram._balance(bot=MagicMock(), update=update)
|
||||
result = msg_mock.call_args_list[0][0][0]
|
||||
assert msg_mock.call_count == 1
|
||||
assert "Running in Dry Run, balances are not available." in result
|
||||
|
||||
|
||||
def test_balance_handle_too_large_response(default_conf, update, mocker) -> None:
|
||||
|
|
Loading…
Reference in New Issue
Block a user