@@ -531,7 +531,7 @@ async def test_collect_agent_mode_http_success(channel):
531531
532532
533533@pytest .mark .asyncio
534- async def test_collect_agent_mode_ws_protocol_not_implemented (channel ):
534+ async def test_collect_agent_mode_ws_protocol_not_implemented (channel , db_engine ):
535535 """Agent mode with ws protocol returns fail (not yet implemented)."""
536536 from unittest .mock import create_autospec
537537
@@ -553,6 +553,7 @@ async def test_collect_agent_mode_ws_protocol_not_implemented(channel):
553553 with (
554554 patch ("backend.browser_pool.get_pool" , return_value = mock_pool ),
555555 patch ("backend.config.get_settings" , return_value = mock_settings ),
556+ patch ("backend.database.AsyncSessionLocal" , _sessionmaker (db_engine )),
556557 ):
557558 result = await channel .collect (
558559 {"site" : "example.com" , "command" : "list" }, {}
@@ -563,7 +564,7 @@ async def test_collect_agent_mode_ws_protocol_not_implemented(channel):
563564
564565
565566@pytest .mark .asyncio
566- async def test_collect_agent_mode_unknown_protocol (channel ):
567+ async def test_collect_agent_mode_unknown_protocol (channel , db_engine ):
567568 """Agent mode with unknown protocol returns fail."""
568569 from unittest .mock import create_autospec
569570
@@ -584,6 +585,7 @@ async def test_collect_agent_mode_unknown_protocol(channel):
584585 with (
585586 patch ("backend.browser_pool.get_pool" , return_value = mock_pool ),
586587 patch ("backend.config.get_settings" , return_value = mock_settings ),
588+ patch ("backend.database.AsyncSessionLocal" , _sessionmaker (db_engine )),
587589 ):
588590 result = await channel .collect (
589591 {"site" : "example.com" , "command" : "list" }, {}
0 commit comments