Update tests to reflect new naming

This commit is contained in:
Matthias 2022-06-09 06:45:22 +02:00
parent a547001601
commit 88f8cbe172
2 changed files with 5 additions and 4 deletions

View File

@ -657,6 +657,7 @@ class Telegram(RPCHandler):
:return: None
"""
self._timeunit_stats(update, context, 'months')
@authorized_only
def _profit(self, update: Update, context: CallbackContext) -> None:
"""

View File

@ -284,7 +284,7 @@ def test_rpc_status_table(default_conf, ticker, fee, mocker) -> None:
assert isnan(fiat_profit_sum)
def test_rpc_daily_profit(default_conf, update, ticker, fee,
def test__rpc_timeunit_profit(default_conf, update, ticker, fee,
limit_buy_order, limit_sell_order, markets, mocker) -> None:
mocker.patch('freqtrade.rpc.telegram.Telegram', MagicMock())
mocker.patch.multiple(
@ -316,7 +316,7 @@ def test_rpc_daily_profit(default_conf, update, ticker, fee,
# Try valid data
update.message.text = '/daily 2'
days = rpc._rpc_daily_profit(7, stake_currency, fiat_display_currency)
days = rpc._rpc_timeunit_profit(7, stake_currency, fiat_display_currency)
assert len(days['data']) == 7
assert days['stake_currency'] == default_conf['stake_currency']
assert days['fiat_display_currency'] == default_conf['fiat_display_currency']
@ -332,7 +332,7 @@ def test_rpc_daily_profit(default_conf, update, ticker, fee,
# Try invalid data
with pytest.raises(RPCException, match=r'.*must be an integer greater than 0*'):
rpc._rpc_daily_profit(0, stake_currency, fiat_display_currency)
rpc._rpc_timeunit_profit(0, stake_currency, fiat_display_currency)
@pytest.mark.parametrize('is_short', [True, False])