|
9 | 9 | from jsonschema import ValidationError |
10 | 10 |
|
11 | 11 | from freqtrade.commands import Arguments |
12 | | -from freqtrade.configuration import Configuration, validate_config_consistency |
13 | | -from freqtrade.configuration.config_secrets import sanitize_config |
| 12 | +from freqtrade.configuration import ( |
| 13 | + Configuration, |
| 14 | + remove_exchange_credentials, |
| 15 | + sanitize_config, |
| 16 | + validate_config_consistency, |
| 17 | +) |
14 | 18 | from freqtrade.configuration.config_validation import validate_config_schema |
15 | 19 | from freqtrade.configuration.deprecated_settings import ( |
16 | 20 | check_conflicting_settings, |
@@ -1587,3 +1591,17 @@ def test_sanitize_config(default_conf_usdt): |
1587 | 1591 | res = sanitize_config(default_conf_usdt, show_sensitive=True) |
1588 | 1592 | assert res["exchange"]["key"] == default_conf_usdt["exchange"]["key"] |
1589 | 1593 | assert res["exchange"]["secret"] == default_conf_usdt["exchange"]["secret"] |
| 1594 | + |
| 1595 | + |
| 1596 | +def test_remove_exchange_credentials(default_conf) -> None: |
| 1597 | + conf = deepcopy(default_conf) |
| 1598 | + remove_exchange_credentials(conf["exchange"], False) |
| 1599 | + |
| 1600 | + assert conf["exchange"]["key"] != "" |
| 1601 | + assert conf["exchange"]["secret"] != "" |
| 1602 | + |
| 1603 | + remove_exchange_credentials(conf["exchange"], True) |
| 1604 | + assert conf["exchange"]["key"] == "" |
| 1605 | + assert conf["exchange"]["secret"] == "" |
| 1606 | + assert conf["exchange"]["password"] == "" |
| 1607 | + assert conf["exchange"]["uid"] == "" |
0 commit comments