diff --git a/pyproject.toml b/pyproject.toml index a5a56c2..b6bb738 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,7 @@ dependencies = [ "pillow>=10.0", "requests>=2.31", "rich>=13.0", + "httpx>=0.27", ] [project.optional-dependencies] @@ -25,7 +26,6 @@ dev = [ "pytest>=8.0", "pytest-cov>=5.0", "pytest-asyncio>=0.23", - "httpx>=0.27", ] [project.scripts] diff --git a/tests/test_main.py b/tests/test_main.py index 39a380b..4626726 100644 --- a/tests/test_main.py +++ b/tests/test_main.py @@ -229,6 +229,17 @@ def test_run_live_catchup_sell_from_gray_then_dark_red(monkeypatch, tmp_path): def step(self, *a, **kw): return types.SimpleNamespace(status="pending", levels=None) + class _StubPoller: + def __init__(self, *a, **kw): pass + async def run(self): await asyncio.sleep(9999) + + class _StubScheduler: + def __init__(self, *a, **kw): + self.is_running = False + def start(self, interval_s): self.is_running = True + def stop(self): self.is_running = False + async def run(self): await asyncio.sleep(9999) + monkeypatch.setattr("atm.detector.Detector", ScriptedDetector) monkeypatch.setattr("atm.canary.Canary", FakeCanary) monkeypatch.setattr("atm.notifier.fanout.FanoutNotifier", FakeFanout) @@ -238,6 +249,8 @@ def test_run_live_catchup_sell_from_gray_then_dark_red(monkeypatch, tmp_path): monkeypatch.setattr("atm.levels.LevelsExtractor", _Stub) monkeypatch.setattr("atm.main._build_capture", fake_build_capture) monkeypatch.setattr("atm.main.time.sleep", lambda s: None) + monkeypatch.setattr("atm.commands.TelegramPoller", _StubPoller) + monkeypatch.setattr("atm.scheduler.ScreenshotScheduler", _StubScheduler) with pytest.raises(_StopLoop): _main.run_live(cfg, duration_s=None)