WIP: PAIN
This commit is contained in:
@@ -1,18 +1,18 @@
|
||||
import unittest
|
||||
from unittest.mock import patch
|
||||
import conductor_tech_lead
|
||||
from src import conductor_tech_lead
|
||||
import pytest
|
||||
|
||||
class TestConductorTechLead(unittest.TestCase):
|
||||
def test_generate_tickets_parse_error(self) -> None:
|
||||
with patch('ai_client.send') as mock_send:
|
||||
with patch('src.ai_client.send') as mock_send:
|
||||
mock_send.return_value = "invalid json"
|
||||
# conductor_tech_lead.generate_tickets returns [] on error, doesn't raise
|
||||
tickets = conductor_tech_lead.generate_tickets("brief", "skeletons")
|
||||
self.assertEqual(tickets, [])
|
||||
|
||||
def test_generate_tickets_success(self) -> None:
|
||||
with patch('ai_client.send') as mock_send:
|
||||
with patch('src.ai_client.send') as mock_send:
|
||||
mock_send.return_value = '[{"id": "T1", "description": "desc", "depends_on": []}]'
|
||||
tickets = conductor_tech_lead.generate_tickets("brief", "skeletons")
|
||||
self.assertEqual(len(tickets), 1)
|
||||
@@ -46,8 +46,8 @@ class TestTopologicalSort(unittest.TestCase):
|
||||
]
|
||||
with self.assertRaises(ValueError) as cm:
|
||||
conductor_tech_lead.topological_sort(tickets)
|
||||
# Align with DAG Validation Error wrapping
|
||||
self.assertIn("DAG Validation Error", str(cm.exception))
|
||||
# Match against our new standard ValueError message
|
||||
self.assertIn("Dependency cycle detected", str(cm.exception))
|
||||
|
||||
def test_topological_sort_empty(self) -> None:
|
||||
self.assertEqual(conductor_tech_lead.topological_sort([]), [])
|
||||
@@ -62,8 +62,7 @@ class TestTopologicalSort(unittest.TestCase):
|
||||
with self.assertRaises(KeyError):
|
||||
conductor_tech_lead.topological_sort(tickets)
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_topological_sort_vlog(vlogger) -> None:
|
||||
def test_topological_sort_vlog(vlogger) -> None:
|
||||
tickets = [
|
||||
{"id": "t2", "depends_on": ["t1"]},
|
||||
{"id": "t1", "depends_on": []},
|
||||
|
||||
Reference in New Issue
Block a user