diff --git a/freqtrade/commands/deploy_ui.py b/freqtrade/commands/deploy_ui.py index 8a9f9b254..a5afe06be 100644 --- a/freqtrade/commands/deploy_ui.py +++ b/freqtrade/commands/deploy_ui.py @@ -68,6 +68,7 @@ def download_and_install_ui(dest_folder: Path, dl_url: str, version: str): progress.update(task, advance=len(chunk)) dest_folder.mkdir(parents=True, exist_ok=True) + content.seek(0) with ZipFile(content) as zf: for fn in zf.filelist: with zf.open(fn) as x: diff --git a/freqtrade/resolvers/strategy_resolver.py b/freqtrade/resolvers/strategy_resolver.py index 0f20a2534..797420d31 100644 --- a/freqtrade/resolvers/strategy_resolver.py +++ b/freqtrade/resolvers/strategy_resolver.py @@ -181,7 +181,7 @@ class StrategyResolver(IResolver): ) @staticmethod - def validate_strategy(strategy: IStrategy) -> IStrategy: + def validate_strategy(strategy: IStrategy) -> IStrategy: # noqa: C901 if strategy.config.get("trading_mode", TradingMode.SPOT) != TradingMode.SPOT: # Require new method warn_deprecated_setting(strategy, "sell_profit_only", "exit_profit_only", True) diff --git a/tests/strategy/test_deprecation_warnings.py b/tests/strategy/test_deprecation_warnings.py index f4742b3fe..f3d30eee2 100644 --- a/tests/strategy/test_deprecation_warnings.py +++ b/tests/strategy/test_deprecation_warnings.py @@ -1,10 +1,12 @@ import logging -import pytest + from pandas import DataFrame + from freqtrade.resolvers import StrategyResolver from freqtrade.strategy import IStrategy from tests.conftest import log_has + class StrategyWithLegacyMethods(IStrategy): INTERFACE_VERSION = 2 minimal_roi = {"0": 1} @@ -31,6 +33,18 @@ def test_deprecation_warnings_legacy_methods(default_conf, caplog): # We call validate_strategy directly to check for warnings StrategyResolver.validate_strategy(strategy) - assert log_has("DEPRECATED: Class overrides 'populate_buy_trend'. This method is deprecated and will be removed in a future version. Please use 'populate_entry_trend' instead.", caplog) - assert log_has("DEPRECATED: Class overrides 'populate_sell_trend'. This method is deprecated and will be removed in a future version. Please use 'populate_exit_trend' instead.", caplog) - assert log_has("DEPRECATED: Class overrides 'custom_sell'. This method is deprecated and will be removed in a future version. Please use 'custom_exit' instead.", caplog) + assert log_has( + "DEPRECATED: Class overrides 'populate_buy_trend'. This method is deprecated and " + "will be removed in a future version. Please use 'populate_entry_trend' instead.", + caplog, + ) + assert log_has( + "DEPRECATED: Class overrides 'populate_sell_trend'. This method is deprecated and " + "will be removed in a future version. Please use 'populate_exit_trend' instead.", + caplog, + ) + assert log_has( + "DEPRECATED: Class overrides 'custom_sell'. This method is deprecated and " + "will be removed in a future version. Please use 'custom_exit' instead.", + caplog, + )