Update /profit telegram message to support non-closed trades

This commit is contained in:
Matthias
2020-05-29 09:38:12 +02:00
parent 6261aef314
commit 1d6e3fea85
4 changed files with 24 additions and 15 deletions

View File

@@ -420,7 +420,7 @@ def test_profit_handle(default_conf, update, ticker, ticker_sell_up, fee,
telegram._profit(update=update, context=MagicMock())
assert msg_mock.call_count == 1
assert 'no closed trade' in msg_mock.call_args_list[0][0][0]
assert 'No closed trade' in msg_mock.call_args_list[0][0][0]
msg_mock.reset_mock()
# Create some test data
@@ -432,7 +432,9 @@ def test_profit_handle(default_conf, update, ticker, ticker_sell_up, fee,
telegram._profit(update=update, context=MagicMock())
assert msg_mock.call_count == 1
assert 'no closed trade' in msg_mock.call_args_list[-1][0][0]
assert 'No closed trade' in msg_mock.call_args_list[-1][0][0]
assert '*ROI:* All trades' in msg_mock.call_args_list[-1][0][0]
assert '∙ `-0.00000500 BTC (-0.50%)`' in msg_mock.call_args_list[-1][0][0]
msg_mock.reset_mock()
# Update the ticker with a market going up