WIP: stage all uncommitted work — sprints 46-221, graduation headers, specialist fleet, test steps 909-1988
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
9
example_projects/py_cli_todo/PROJECT_META.md
Normal file
9
example_projects/py_cli_todo/PROJECT_META.md
Normal file
@@ -0,0 +1,9 @@
|
||||
# py_cli_todo
|
||||
|
||||
- stack: python
|
||||
- validator: pytest -q
|
||||
- common_failure_modes: arg validation, off-by-one index, missing tests
|
||||
|
||||
## Scope
|
||||
|
||||
Small representative project for training data generation.
|
||||
7
example_projects/py_cli_todo/TASKS.md
Normal file
7
example_projects/py_cli_todo/TASKS.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# Task Seeds: py_cli_todo
|
||||
|
||||
src/todo.py, tests/test_todo.py
|
||||
|
||||
## Validator
|
||||
|
||||
`pytest -q`
|
||||
11
example_projects/py_cli_todo/src/todo.py
Normal file
11
example_projects/py_cli_todo/src/todo.py
Normal file
@@ -0,0 +1,11 @@
|
||||
def add_task(tasks, title):
|
||||
title = title.strip()
|
||||
if not title:
|
||||
raise ValueError("title is required")
|
||||
tasks.append({"title": title, "done": False})
|
||||
return tasks
|
||||
|
||||
|
||||
def complete_task(tasks, index):
|
||||
tasks[index]["done"] = True
|
||||
return tasks
|
||||
8
example_projects/py_cli_todo/tests/test_todo.py
Normal file
8
example_projects/py_cli_todo/tests/test_todo.py
Normal file
@@ -0,0 +1,8 @@
|
||||
from src.todo import add_task, complete_task
|
||||
|
||||
|
||||
def test_add_and_complete():
|
||||
tasks = []
|
||||
add_task(tasks, "pay bills")
|
||||
complete_task(tasks, 0)
|
||||
assert tasks[0]["done"] is True
|
||||
Reference in New Issue
Block a user