feat: Allow empty fiat_display_currency
(instead of completely deleting that key)
This commit is contained in:
@@ -156,6 +156,7 @@ SUPPORTED_FIAT = [
|
|||||||
"LTC",
|
"LTC",
|
||||||
"BCH",
|
"BCH",
|
||||||
"BNB",
|
"BNB",
|
||||||
|
"", # Allow empty field in config.
|
||||||
]
|
]
|
||||||
|
|
||||||
MINIMAL_CONFIG = {
|
MINIMAL_CONFIG = {
|
||||||
|
|||||||
@@ -2564,10 +2564,14 @@ def test_send_msg_buy_notification_no_fiat(
|
|||||||
("Short", "short_signal_01", 2.0),
|
("Short", "short_signal_01", 2.0),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
@pytest.mark.parametrize("fiat", ["", None])
|
||||||
def test_send_msg_exit_notification_no_fiat(
|
def test_send_msg_exit_notification_no_fiat(
|
||||||
default_conf, mocker, direction, enter_signal, leverage, time_machine
|
default_conf, mocker, direction, enter_signal, leverage, time_machine, fiat
|
||||||
) -> None:
|
) -> None:
|
||||||
del default_conf["fiat_display_currency"]
|
if fiat is None:
|
||||||
|
del default_conf["fiat_display_currency"]
|
||||||
|
else:
|
||||||
|
default_conf["fiat_display_currency"] = fiat
|
||||||
time_machine.move_to("2022-05-02 00:00:00 +00:00", tick=False)
|
time_machine.move_to("2022-05-02 00:00:00 +00:00", tick=False)
|
||||||
telegram, _, msg_mock = get_telegram_testobject(mocker, default_conf)
|
telegram, _, msg_mock = get_telegram_testobject(mocker, default_conf)
|
||||||
|
|
||||||
|
|||||||
@@ -659,6 +659,16 @@ def test_validate_default_conf(default_conf) -> None:
|
|||||||
validate_config_schema(default_conf)
|
validate_config_schema(default_conf)
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.parametrize("fiat", ["EUR", "USD", "", None])
|
||||||
|
def test_validate_fiat_currency_options(default_conf, fiat) -> None:
|
||||||
|
# Validate via our validator - we allow setting defaults!
|
||||||
|
if fiat is not None:
|
||||||
|
default_conf["fiat_display_currency"] = fiat
|
||||||
|
else:
|
||||||
|
del default_conf["fiat_display_currency"]
|
||||||
|
validate_config_schema(default_conf)
|
||||||
|
|
||||||
|
|
||||||
def test_validate_max_open_trades(default_conf):
|
def test_validate_max_open_trades(default_conf):
|
||||||
default_conf["max_open_trades"] = float("inf")
|
default_conf["max_open_trades"] = float("inf")
|
||||||
default_conf["stake_amount"] = "unlimited"
|
default_conf["stake_amount"] = "unlimited"
|
||||||
|
|||||||
Reference in New Issue
Block a user