diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py index ab4ea8dce..fe426b252 100644 --- a/tests/exchange/test_exchange.py +++ b/tests/exchange/test_exchange.py @@ -35,7 +35,6 @@ from freqtrade.exchange.common import ( API_FETCH_ORDER_RETRY_COUNT, API_RETRY_COUNT, calculate_backoff, - remove_exchange_credentials, ) from freqtrade.resolvers.exchange_resolver import ExchangeResolver from freqtrade.util import dt_now, dt_ts @@ -167,20 +166,6 @@ def test_init(default_conf, mocker, caplog): assert log_has("Instance is running with dry_run enabled", caplog) -def test_remove_exchange_credentials(default_conf) -> None: - conf = deepcopy(default_conf) - remove_exchange_credentials(conf["exchange"], False) - - assert conf["exchange"]["key"] != "" - assert conf["exchange"]["secret"] != "" - - remove_exchange_credentials(conf["exchange"], True) - assert conf["exchange"]["key"] == "" - assert conf["exchange"]["secret"] == "" - assert conf["exchange"]["password"] == "" - assert conf["exchange"]["uid"] == "" - - def test_init_ccxt_kwargs(default_conf, mocker, caplog): mocker.patch(f"{EXMS}.reload_markets") mocker.patch(f"{EXMS}.validate_stakecurrency") diff --git a/tests/test_configuration.py b/tests/test_configuration.py index 2ae72692b..b395e34f0 100644 --- a/tests/test_configuration.py +++ b/tests/test_configuration.py @@ -9,8 +9,12 @@ import pytest from jsonschema import ValidationError from freqtrade.commands import Arguments -from freqtrade.configuration import Configuration, validate_config_consistency -from freqtrade.configuration.config_secrets import sanitize_config +from freqtrade.configuration import ( + Configuration, + remove_exchange_credentials, + sanitize_config, + validate_config_consistency, +) from freqtrade.configuration.config_validation import validate_config_schema from freqtrade.configuration.deprecated_settings import ( check_conflicting_settings, @@ -1587,3 +1591,17 @@ def test_sanitize_config(default_conf_usdt): res = sanitize_config(default_conf_usdt, show_sensitive=True) assert res["exchange"]["key"] == default_conf_usdt["exchange"]["key"] assert res["exchange"]["secret"] == default_conf_usdt["exchange"]["secret"] + + +def test_remove_exchange_credentials(default_conf) -> None: + conf = deepcopy(default_conf) + remove_exchange_credentials(conf["exchange"], False) + + assert conf["exchange"]["key"] != "" + assert conf["exchange"]["secret"] != "" + + remove_exchange_credentials(conf["exchange"], True) + assert conf["exchange"]["key"] == "" + assert conf["exchange"]["secret"] == "" + assert conf["exchange"]["password"] == "" + assert conf["exchange"]["uid"] == ""