From 459fae6d80608f45b5f34dcfb61a0de388035d5f Mon Sep 17 00:00:00 2001 From: Eugene Schava Date: Mon, 17 May 2021 16:22:48 +0300 Subject: [PATCH] Total row for telegram "/status table" command fixes --- freqtrade/rpc/rpc.py | 3 ++- tests/rpc/test_rpc.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/freqtrade/rpc/rpc.py b/freqtrade/rpc/rpc.py index 9b0ef2ad0..3f26619a9 100644 --- a/freqtrade/rpc/rpc.py +++ b/freqtrade/rpc/rpc.py @@ -244,7 +244,8 @@ class RPC: ) if fiat_profit and not isnan(fiat_profit): profit_str += f" ({fiat_profit:.2f})" - fiat_profit_sum = fiat_profit if isnan(fiat_profit_sum) else fiat_profit_sum + fiat_profit + fiat_profit_sum = fiat_profit if isnan(fiat_profit_sum) \ + else fiat_profit_sum + fiat_profit trades_list.append([ trade.id, trade.pair + ('*' if (trade.open_order_id is not None diff --git a/tests/rpc/test_rpc.py b/tests/rpc/test_rpc.py index 0ae214615..b005fb105 100644 --- a/tests/rpc/test_rpc.py +++ b/tests/rpc/test_rpc.py @@ -215,7 +215,7 @@ def test_rpc_status_table(default_conf, ticker, fee, mocker) -> None: assert 'instantly' == result[0][2] assert 'ETH/BTC' in result[0][1] assert '-0.41% (-0.06)' == result[0][3] - assert -0.06 == fiat_profit_sum + assert '-0.06' == f'{fiat_profit_sum:.2f}' mocker.patch('freqtrade.freqtradebot.FreqtradeBot.get_sell_rate', MagicMock(side_effect=ExchangeError("Pair 'ETH/BTC' not available")))