feat: scaffold agent-todo-tracker P2 project
This commit is contained in:
commit
1c20079608
11 files changed
+393
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,29 @@
|
||||
from agent_todos.models import Priority, Status, Todo
|
||||
from agent_todos.store import Store
|
||||
|
||||
|
||||
def _store(tmp_path, name="test.db") -> tuple[Store, str]:
|
||||
p = str(tmp_path / name)
|
||||
return Store(db_path=p), p
|
||||
|
||||
|
||||
def test_create_and_list(tmp_path):
|
||||
store, _ = _store(tmp_path)
|
||||
todo = store.create(Todo(id=None, title="Test task", repo="org/repo", priority=Priority.high))
|
||||
assert todo.id is not None
|
||||
all_todos = store.list()
|
||||
assert any(t.id == todo.id for t in all_todos)
|
||||
|
||||
|
||||
def test_update_status(tmp_path):
|
||||
store, _ = _store(tmp_path)
|
||||
todo = store.create(Todo(id=None, title="Test task"))
|
||||
updated = store.update(todo.id, status=Status.in_progress)
|
||||
assert updated.status == Status.in_progress
|
||||
|
||||
|
||||
def test_close_resolves(tmp_path):
|
||||
store, _ = _store(tmp_path)
|
||||
todo = store.create(Todo(id=None, title="Test task"))
|
||||
store.update(todo.id, status=Status.resolved)
|
||||
assert store.get(todo.id).resolved_at is not None
|
||||
Reference in new issue
Block a user