76일차 자료 추가 (답 포함): 실습 15개 · 의도 · 생활 속 예 · 실행 결과, LAB-A · 정답 워크플로우와 25단계 실행 기록, 교안 개요 30장 · 4단계 정리, 바이브 코딩 tretry

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mcchaeandClaude Opus 5.5 committed 2026-10-29 23:18:55 +09:00
1 parent 3f36605043
commit bbf17e4696
141 files changed
+34072

No files matched your search

+29
View File
@@ -0,0 +1,29 @@
"""R11: the screen ranks targets by failed tries and lists the tries of the chosen one."""
from textual.widgets import DataTable
from tretry import log
from tretry.app import LogApp
from tretry.retry import Attempt, Result
def make_log(tmp_path):
path = tmp_path / "log.jsonl"
log.write(path, "http", "POST http://x/tickets", Result(False, attempts=[Attempt(1, 0, 3, False, "timeout"), Attempt(2, 3.5, 3, False, "timeout")],
stopped="tries", seconds=6.5), now=100)
log.write(path, "command", "curl ok", Result(True, attempts=[Attempt(1, 0, 0.1, True)], stopped="success", seconds=0.1), now=101)
return path
async def test_tables(tmp_path):
app = LogApp(make_log(tmp_path))
async with app.run_test() as pilot:
await pilot.pause()
targets = app.query_one("#targets", DataTable)
assert targets.row_count == 2 and targets.get_row_at(0)[0] == "POST http://x/tickets" # most failures first
assert app.query_one("#tries", DataTable).row_count == 2
await pilot.press("down")
await pilot.pause()
assert app.query_one("#tries", DataTable).row_count == 1
await pilot.press("f")
await pilot.pause()
assert app.query_one("#tries", DataTable).row_count == 0