дзеркало
https://github.com/l0ng-ai/openidea.git
синхронізовано 2026-11-09 11:15:40 +02:00
Initial open-source release
Claude-Session: https://claude.ai/code/session_01B65qLEKnkeYTGdbwhLpjCu
Цей коміт міститься в:
коміт
9a2025b76e
2034 files changed
+243381
No files matched your search
@@ -0,0 +1,39 @@
|
||||
import os
|
||||
from datetime import date
|
||||
|
||||
import pytest
|
||||
|
||||
from tasks import Priority, TaskList
|
||||
|
||||
|
||||
def test_pending_is_sorted_by_priority():
|
||||
tasks = TaskList()
|
||||
tasks.add("low", Priority.LOW)
|
||||
tasks.add("high", Priority.HIGH)
|
||||
assert [t.title for t in tasks.pending()] == ["high", "low"]
|
||||
|
||||
|
||||
def test_complete_and_overdue():
|
||||
tasks = TaskList()
|
||||
tasks.add("late", Priority.NORMAL, date(2020, 1, 1))
|
||||
assert [t.title for t in tasks.overdue(date(2024, 1, 1))] == ["late"]
|
||||
tasks.complete("late")
|
||||
assert tasks.overdue(date(2024, 1, 1)) == []
|
||||
|
||||
|
||||
def test_rejects_empty_titles():
|
||||
with pytest.raises(ValueError):
|
||||
TaskList().add(" ")
|
||||
|
||||
|
||||
def test_tags():
|
||||
tasks = TaskList()
|
||||
tasks.add("a", Priority.LOW, None, "x", "y")
|
||||
tasks.add("b", Priority.LOW, None, "y")
|
||||
assert len(tasks.by_tag("y")) == 2
|
||||
|
||||
|
||||
@pytest.mark.skipif(not os.environ.get("OPENIDEA_FAIL"), reason="set OPENIDEA_FAIL=1 to run")
|
||||
def test_intentionally_failing():
|
||||
# FIXME: wrong on purpose (QA: failing test in the test tree)
|
||||
assert len(TaskList()) == 1
|
||||
Reference in new issue
Заблокувати користувача