feat(models): Add manual_block field and methods to Ticket

This commit is contained in:
2026-03-07 16:25:44 -05:00
parent 97b5bd953d
commit 094a6c3c22
2 changed files with 37 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
import pytest
from src.models import Ticket
def test_ticket_has_manual_block_field():
t = Ticket(id="T-001", description="Test")
assert hasattr(t, 'manual_block'), "Ticket must have manual_block field"
assert t.manual_block == False, "manual_block should default to False"
def test_mark_manual_block_method():
t = Ticket(id="T-001", description="Test")
t.mark_manual_block("Test reason")
assert t.status == "blocked", "Status should be blocked"
assert t.manual_block == True, "manual_block should be True"
assert "[MANUAL]" in t.blocked_reason, "blocked_reason should contain [MANUAL]"
def test_clear_manual_block_method():
t = Ticket(id="T-001", description="Test")
t.mark_manual_block("Test reason")
assert t.manual_block == True
t.clear_manual_block()
assert t.status == "todo", "Status should be restored to todo"
assert t.manual_block == False, "manual_block should be False"
assert t.blocked_reason is None, "blocked_reason should be cleared"