mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-02 18:13:04 +00:00
Add test for ask_orderbook validation
This commit is contained in:
@@ -935,6 +935,23 @@ def test_validate_protections(default_conf, protconf, expected):
|
||||
validate_config_consistency(conf)
|
||||
|
||||
|
||||
def test_validate_ask_orderbook(default_conf, caplog) -> None:
|
||||
conf = deepcopy(default_conf)
|
||||
conf['ask_strategy']['use_order_book'] = True
|
||||
conf['ask_strategy']['order_book_min'] = 2
|
||||
conf['ask_strategy']['order_book_max'] = 2
|
||||
|
||||
validate_config_consistency(conf)
|
||||
assert log_has_re(r"DEPRECATED: Please use `order_book_top` instead of.*", caplog)
|
||||
assert conf['ask_strategy']['order_book_top'] == 2
|
||||
|
||||
conf['ask_strategy']['order_book_max'] = 5
|
||||
|
||||
with pytest.raises(OperationalException,
|
||||
match=r"Using order_book_max != order_book_min in ask_strategy.*"):
|
||||
validate_config_consistency(conf)
|
||||
|
||||
|
||||
def test_load_config_test_comments() -> None:
|
||||
"""
|
||||
Load config with comments
|
||||
|
||||
Reference in New Issue
Block a user