Initial TradeBot implementation
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from crypto_spot_bot.dashboard import _apply_fast_trading
|
||||
from crypto_spot_bot.storage import Storage
|
||||
|
||||
|
||||
def test_apply_fast_trading_updates_runtime_and_env(make_settings, tmp_path) -> None:
|
||||
settings = make_settings(tmp_path, fast_trading_enabled=False)
|
||||
settings.env_file_path.write_text("FAST_TRADING_ENABLED=false\n", encoding="utf-8")
|
||||
storage = Storage(settings.database_path)
|
||||
|
||||
env_persisted = _apply_fast_trading(settings, storage, True)
|
||||
|
||||
assert env_persisted is True
|
||||
assert settings.fast_trading_enabled is True
|
||||
assert storage.get_runtime("fast_trading_enabled") is True
|
||||
assert "FAST_TRADING_ENABLED=true" in settings.env_file_path.read_text(encoding="utf-8")
|
||||
Reference in New Issue
Block a user