Skip to content

Commit 8612c7a

Browse files
authored
Merge pull request #8 from 2233admin/fix/browser-bindings-test-db-session
browser_bindings no-such-table修复,CI全绿(Backend Quality/Alembic/ODP Rust/Browser Extension/CodeRabbit)。
2 parents a98dda4 + 87ea319 commit 8612c7a

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tests/unit/channels/test_opencli_channel.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)