mirror of
https://github.com/pyMC-dev/pyMC_Repeater.git
synced 2026-07-05 01:12:38 +02:00
refactor(api_endpoints): improve sqlite_handler retrieval logic
- Updated the logic for retrieving the sqlite_handler in APIEndpoints to use a safer approach with getattr, ensuring compatibility with the daemon_instance. - Adjusted test case to include an additional parameter in the sqlite.companion_push_message assertion for consistency.
This commit is contained in:
@@ -147,7 +147,7 @@ async def test_frame_server_persistence_paths_and_stop():
|
||||
srv._build_message_frame = MagicMock(return_value=b"frame")
|
||||
|
||||
await srv._persist_companion_message({"text": "x"})
|
||||
sqlite.companion_push_message.assert_called_once_with("h", {"text": "x"})
|
||||
sqlite.companion_push_message.assert_called_once_with("h", {"text": "x"}, None)
|
||||
bridge.message_queue.pop_last.assert_called_once()
|
||||
|
||||
msg = srv._sync_next_from_persistence()
|
||||
|
||||
Reference in New Issue
Block a user