Improve code quality
This commit is contained in:
@@ -652,7 +652,7 @@ def test_monthly_handle(default_conf_usdt, update, ticker, fee, mocker, time_mac
|
||||
|
||||
# The one-digit months should contain a zero, Eg: September 2021 = "2021-09"
|
||||
# Since we loaded the last 12 months, any month should appear
|
||||
assert str('-09') in msg_mock.call_args_list[0][0][0]
|
||||
assert '-09' in msg_mock.call_args_list[0][0][0]
|
||||
|
||||
# Try invalid data
|
||||
msg_mock.reset_mock()
|
||||
@@ -671,7 +671,7 @@ def test_monthly_handle(default_conf_usdt, update, ticker, fee, mocker, time_mac
|
||||
context = MagicMock()
|
||||
context.args = ["february"]
|
||||
telegram._monthly(update=update, context=context)
|
||||
assert str('Monthly Profit over the last 6 months</b>:') in msg_mock.call_args_list[0][0][0]
|
||||
assert 'Monthly Profit over the last 6 months</b>:' in msg_mock.call_args_list[0][0][0]
|
||||
|
||||
|
||||
def test_profit_handle(default_conf_usdt, update, ticker_usdt, ticker_sell_up, fee,
|
||||
@@ -1730,14 +1730,14 @@ def test_version_handle(default_conf, update, mocker) -> None:
|
||||
|
||||
telegram._version(update=update, context=MagicMock())
|
||||
assert msg_mock.call_count == 1
|
||||
assert '*Version:* `{}`'.format(__version__) in msg_mock.call_args_list[0][0][0]
|
||||
assert f'*Version:* `{__version__}`' in msg_mock.call_args_list[0][0][0]
|
||||
|
||||
msg_mock.reset_mock()
|
||||
freqtradebot.strategy.version = lambda: '1.1.1'
|
||||
|
||||
telegram._version(update=update, context=MagicMock())
|
||||
assert msg_mock.call_count == 1
|
||||
assert '*Version:* `{}`'.format(__version__) in msg_mock.call_args_list[0][0][0]
|
||||
assert f'*Version:* `{__version__}`' in msg_mock.call_args_list[0][0][0]
|
||||
assert '*Strategy version: * `1.1.1`' in msg_mock.call_args_list[0][0][0]
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user