From 6d2a1cfb442de9aa6ba11a008640df99b32553a8 Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 24 Apr 2019 09:30:59 +0200 Subject: [PATCH] remove full-config in tests and load full_config file --- freqtrade/tests/conftest.py | 65 --------------------------- freqtrade/tests/test_configuration.py | 9 ++++ 2 files changed, 9 insertions(+), 65 deletions(-) diff --git a/freqtrade/tests/conftest.py b/freqtrade/tests/conftest.py index b19518ee7..0bff1d5e9 100644 --- a/freqtrade/tests/conftest.py +++ b/freqtrade/tests/conftest.py @@ -197,71 +197,6 @@ def default_conf(): return configuration -@pytest.fixture(scope="function") -def all_conf(): - """ Returns validated configuration with all options """ - configuration = { - "max_open_trades": 1, - "stake_currency": "BTC", - "stake_amount": 0.001, - "fiat_display_currency": "USD", - "ticker_interval": '5m', - "dry_run": True, - "minimal_roi": { - "40": 0.0, - "30": 0.01, - "20": 0.02, - "0": 0.04 - }, - "stoploss": -0.10, - "unfilledtimeout": { - "buy": 10, - "sell": 30 - }, - "bid_strategy": { - "ask_last_balance": 0.0, - "use_order_book": False, - "order_book_top": 1, - "check_depth_of_market": { - "enabled": False, - "bids_to_ask_delta": 1 - } - }, - "ask_strategy": { - "use_order_book": False, - "order_book_min": 1, - "order_book_max": 1 - }, - "exchange": { - "name": "bittrex", - "sandbox": False, - "enabled": True, - "key": "key", - "secret": "secret", - "password": "password", - "pair_whitelist": [ - "ETH/BTC", - "LTC/BTC", - "XRP/BTC", - "NEO/BTC" - ], - "pair_blacklist": [ - "DOGE/BTC", - "HOT/BTC", - ] - }, - "telegram": { - "enabled": True, - "token": "token", - "chat_id": "0" - }, - "initial_state": "running", - "db_url": "sqlite://", - "loglevel": logging.DEBUG, - } - return configuration - - @pytest.fixture def update(): _update = Update(0) diff --git a/freqtrade/tests/test_configuration.py b/freqtrade/tests/test_configuration.py index dde9ea271..dce76f25e 100644 --- a/freqtrade/tests/test_configuration.py +++ b/freqtrade/tests/test_configuration.py @@ -18,6 +18,15 @@ from freqtrade.state import RunMode from freqtrade.tests.conftest import log_has +@pytest.fixture(scope="function") +def all_conf(): + config_file = Path(__file__).parents[2] / "config_full.json.example" + print(config_file) + configuration = Configuration(Namespace()) + conf = configuration._load_config_file(str(config_file)) + return conf + + def test_load_config_invalid_pair(default_conf) -> None: default_conf['exchange']['pair_whitelist'].append('ETH-BTC')