Spaces:
Build error
Build error
| # SPDX-FileCopyrightText: 2026 Team Centurions | |
| # SPDX-License-Identifier: AGPL-3.0-or-later | |
| import pytest | |
| from pydantic import ValidationError | |
| from pageparse.schema import Record, SourceParseResult | |
| def test_task_defaults(): | |
| t = Record(content="Buy milk") | |
| assert t.content == "Buy milk" | |
| assert t.priority is None | |
| assert t.status == "todo" | |
| assert t.confidence == 1.0 | |
| def test_task_invalid_priority(): | |
| with pytest.raises(ValidationError): | |
| Record(content="Test", priority="urgent") | |
| def test_task_invalid_status(): | |
| with pytest.raises(ValidationError): | |
| Record(content="Test", status="in_progress") | |
| def test_page_parse_result(): | |
| result = SourceParseResult( | |
| source_file="test.jpg", | |
| records=[Record(content="Task 1"), Record(content="Task 2", priority="high")], | |
| ) | |
| assert len(result.records) == 2 | |
| assert result.records[1].priority == "high" | |