diff --git a/src/poller/main.py b/src/poller/main.py index 8dc7eb6..49d7cea 100644 --- a/src/poller/main.py +++ b/src/poller/main.py @@ -47,7 +47,7 @@ async def watch( ) for key in body.tickets: await watcher.add(key.upper()) - return {"watching": watcher.list()} + return {"watching": watcher.list_tickets()} @app.delete("/watch/{ticket_key}", status_code=200) @@ -55,12 +55,12 @@ async def unwatch(ticket_key: str) -> dict[str, Any]: removed = await watcher.remove(ticket_key.upper()) if not removed: raise HTTPException(status_code=404, detail=f"{ticket_key} not in watch list") - return {"watching": watcher.list()} + return {"watching": watcher.list_tickets()} @app.get("/watch") async def list_watched() -> dict[str, Any]: - return {"watching": watcher.list()} + return {"watching": watcher.list_tickets()} @app.get("/health") diff --git a/src/poller/watcher.py b/src/poller/watcher.py index 6cfb4ba..50fa6e4 100644 --- a/src/poller/watcher.py +++ b/src/poller/watcher.py @@ -68,7 +68,7 @@ async def remove(self, ticket_key: str) -> bool: save_state(self._state_file, self._state) return True - def list(self) -> list[dict]: + def list_tickets(self) -> list[dict]: def _entry(s: TicketState, children: list[dict] | None = None) -> dict: return { "ticket_key": s.ticket_key, diff --git a/tests/test_epic_sync.py b/tests/test_epic_sync.py index caf2923..3d9de02 100644 --- a/tests/test_epic_sync.py +++ b/tests/test_epic_sync.py @@ -221,7 +221,7 @@ def test_children_nested_under_parent(self): ), } - result = watcher.list() + result = watcher.list_tickets() parents = [t for t in result if t["ticket_key"] == "AISOS-566"] assert len(parents) == 1 @@ -239,7 +239,7 @@ def test_children_not_duplicated_at_top_level(self): ), } - result = watcher.list() + result = watcher.list_tickets() top_level_keys = [t["ticket_key"] for t in result] assert "AISOS-567" not in top_level_keys @@ -251,7 +251,7 @@ def test_tickets_without_parent_have_empty_children(self): "AISOS-566": _make_state("AISOS-566", issue_type="Feature"), } - result = watcher.list() + result = watcher.list_tickets() assert result[0]["children"] == [] @@ -266,7 +266,7 @@ def test_orphan_children_appear_at_top_level(self): ), } - result = watcher.list() + result = watcher.list_tickets() assert len(result) == 1 assert result[0]["ticket_key"] == "AISOS-567"