This commit is contained in:
richarjiang
2026-09-24 10:04:41 +08:00
commit eae4df7d51
24 changed files with 2212 additions and 0 deletions

11
tests/test_feed.py Normal file
View File

@@ -0,0 +1,11 @@
import json
from laya_router.feed import read_routes
def test_read_routes_keeps_the_tail(tmp_path):
path = tmp_path / "routes.jsonl"
lines = [json.dumps({"ts": str(i), "level": "simple"}) for i in range(5)]
path.write_text("\n".join(lines) + "\nbad\n", encoding="utf-8")
records = read_routes(path, limit=2)
assert [item["ts"] for item in records] == ["3", "4"]