79일차 운영 데이터 기반 Ops Assistant: 실습 15개 · 강의(개요 30장 · 단계 문서 · 4단계 정리 · 05 바이브), 정답본 LAB-A · answers · VIBE-A · tops 포함
This commit is contained in:
1 parent
9ce9aceba6
commit
6f0ecd59a9
156 files changed
+31640
No files matched your search
@@ -0,0 +1,34 @@
|
||||
"""R11 · R12: the TUI shows the areas, a tab that cannot read says so, and asking stays read only."""
|
||||
from argparse import Namespace
|
||||
|
||||
from textual.widgets import DataTable, Input, Static
|
||||
|
||||
from conftest import DATA
|
||||
|
||||
from tops.app import OpsApp
|
||||
|
||||
|
||||
async def test_areas_and_ask(fake):
|
||||
app = OpsApp(Namespace(n8n=fake.base, file=None, api=fake.base))
|
||||
async with app.run_test() as pilot:
|
||||
assert app.query_one("#area-table", DataTable).row_count == 6
|
||||
assert "overall 🔴 red" in str(app.query_one("#top", Static).render())
|
||||
await pilot.press("question_mark")
|
||||
app.query_one("#question", Input).value = "DLQ 1번 다시 돌려 줘"
|
||||
await pilot.press("enter")
|
||||
assert "refused (read_only)" in str(app.query_one("#answer", Static).render())
|
||||
assert app.query_one("#audit-table", DataTable).row_count == 3
|
||||
# tlog on the Tools tab reads the run logs too; nothing that changes state is ever called
|
||||
assert not {path for path, _ in fake.calls} & {"/dlq/update", "/dlq-clear", "/ops-reset", "/budget", "/admin/fault", "/release"}
|
||||
|
||||
|
||||
async def test_file_mode_other_tabs_say_not_available(down):
|
||||
app = OpsApp(Namespace(n8n=None, file=str(DATA / "facts-cost-down.json"), api=down))
|
||||
async with app.run_test() as pilot:
|
||||
assert "sources down: cost" in str(app.query_one("#top", Static).render())
|
||||
assert app.query_one("#area-table", DataTable).row_count == 6
|
||||
await pilot.press("question_mark")
|
||||
app.query_one("#question", Input).value = "지난주 오류율이 얼마야?"
|
||||
await pilot.press("enter")
|
||||
assert "not available" in str(app.query_one("#answer", Static).render())
|
||||
assert "not available" in str(app.query_one("#audit-table", DataTable).get_row_at(0)[2])
|
||||
Reference in new issue
Block a user