Show "No trades yet." when no trade happened yet

This commit is contained in:
Matthias 2020-05-30 19:42:09 +02:00
parent 91f84f1a43
commit cc90e7b413
2 changed files with 20 additions and 17 deletions

View File

@ -326,6 +326,9 @@ class Telegram(RPC):
avg_duration = stats['avg_duration']
best_pair = stats['best_pair']
best_rate = stats['best_rate']
if stats['trade_count'] == 0:
markdown_msg = 'No trades yet.'
else:
# Message to display
if stats['closed_trade_count'] > 0:
markdown_msg = ("*ROI:* Closed trades\n"

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 trades yet.' in msg_mock.call_args_list[0][0][0]
msg_mock.reset_mock()
# Create some test data