refactor: remove unreachable code and redundant tests (#6729)

* refactor: prune unreachable runtime and WebUI paths

* test: drop duplicate cases and assertions for obsolete selectors
This commit is contained in:
chengyongru authored and GitHub committed 2026-11-20 11:11:00 +08:00
1 parent b9b491e74c
commit 51fa1a7f74
20 files changed
+32 -163

No files matched your search

-23
View File
@@ -90,14 +90,6 @@ class TestHistoryWithCursor:
assert data["cursor"] == cursor
assert data["content"] == expected_content
def test_read_unprocessed_history(self, store):
store.append_history("event 1")
store.append_history("event 2")
store.append_history("event 3")
entries = store.read_unprocessed_history(since_cursor=1)
assert len(entries) == 2
assert entries[0]["cursor"] == 2
def test_read_unprocessed_history_returns_all_when_cursor_zero(self, store):
store.append_history("event 1")
store.append_history("event 2")
@@ -189,21 +181,6 @@ class TestHistoryWithCursor:
entries = store.read_unprocessed_history(since_cursor=0)
assert [entry["cursor"] for entry in entries] == list(range(21, 101))
def test_write_entries_uses_atomic_write(self, tmp_path):
store = MemoryStore(tmp_path)
store.append_history("event 1")
store.append_history("event 2")
store.append_history("event 3")
entries = store.read_unprocessed_history(since_cursor=0)
tmp_path_obj = store.history_file.with_suffix(".jsonl.tmp")
assert not tmp_path_obj.exists()
store._write_entries(entries)
assert not tmp_path_obj.exists()
assert store.history_file.exists()
def test_write_entries_cleans_up_tmp_on_exception(self, tmp_path, monkeypatch):
store = MemoryStore(tmp_path)
store.append_history("event 1")