mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-22 03:31:02 +02:00
Rev gateway tests
This commit is contained in:
parent
1e0a349b25
commit
a96489b037
1 changed files with 6 additions and 0 deletions
|
|
@ -10,6 +10,9 @@ import uuid
|
||||||
|
|
||||||
from trustgraph.gateway.config.receiver import ConfigReceiver
|
from trustgraph.gateway.config.receiver import ConfigReceiver
|
||||||
|
|
||||||
|
# Save the real method before patching
|
||||||
|
_real_config_loader = ConfigReceiver.config_loader
|
||||||
|
|
||||||
# Patch async methods at module level to prevent coroutine warnings
|
# Patch async methods at module level to prevent coroutine warnings
|
||||||
ConfigReceiver.config_loader = AsyncMock()
|
ConfigReceiver.config_loader = AsyncMock()
|
||||||
|
|
||||||
|
|
@ -243,7 +246,10 @@ class TestConfigReceiver:
|
||||||
async def test_config_loader_creates_consumer(self):
|
async def test_config_loader_creates_consumer(self):
|
||||||
"""Test config_loader method creates Pulsar consumer"""
|
"""Test config_loader method creates Pulsar consumer"""
|
||||||
mock_pulsar_client = Mock()
|
mock_pulsar_client = Mock()
|
||||||
|
|
||||||
config_receiver = ConfigReceiver(mock_pulsar_client)
|
config_receiver = ConfigReceiver(mock_pulsar_client)
|
||||||
|
# Temporarily restore the real config_loader for this test
|
||||||
|
config_receiver.config_loader = _real_config_loader.__get__(config_receiver)
|
||||||
|
|
||||||
# Mock Consumer class
|
# Mock Consumer class
|
||||||
with patch('trustgraph.gateway.config.receiver.Consumer') as mock_consumer_class, \
|
with patch('trustgraph.gateway.config.receiver.Consumer') as mock_consumer_class, \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue