forked from retoor/devplacepy
feat: add TTLCache for get_cache_version and TEMPLATE_AUTO_RELOAD config with Makefile worker count variables
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
# retoor <retoor@molodetz.nl>
|
||||
|
||||
import asyncio
|
||||
import json
|
||||
import tempfile
|
||||
from pathlib import Path
|
||||
|
||||
from tests.conftest import run_async
|
||||
|
||||
from devplacepy.services.jobs.deepsearch import crawl as crawl_module
|
||||
from devplacepy.services.jobs.deepsearch import worker as worker_module
|
||||
from devplacepy.services.jobs.deepsearch.crawl import CrawledPage, CrawlOutcome
|
||||
@@ -79,7 +80,7 @@ def test_worker_run_produces_report(monkeypatch):
|
||||
"collection": "ds_worker_test_one",
|
||||
"cached_hashes": [],
|
||||
}
|
||||
report = asyncio.run(worker_module._run(payload, output_dir))
|
||||
report = run_async(worker_module._run(payload, output_dir))
|
||||
assert report["query"] == "history of the transistor"
|
||||
assert report["page_count"] == 2
|
||||
assert report["chunk_count"] > 0
|
||||
@@ -100,4 +101,4 @@ def test_worker_control_cancel_stops(monkeypatch):
|
||||
output_dir = Path(tmp)
|
||||
(output_dir / "control.json").write_text(json.dumps({"state": "cancelled"}))
|
||||
should_stop = worker_module._make_stop(output_dir)
|
||||
assert asyncio.run(should_stop()) is True
|
||||
assert run_async(should_stop()) is True
|
||||
|
||||
Reference in New Issue
Block a user