mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-24 04:31:02 +02:00
Fix tests
This commit is contained in:
parent
779430f5ce
commit
12fadd0ad6
2 changed files with 36 additions and 12 deletions
|
|
@ -18,7 +18,9 @@ class TestFlowParameterSpecs(IsolatedAsyncioTestCase):
|
||||||
def test_parameter_spec_registration(self, mock_async_init):
|
def test_parameter_spec_registration(self, mock_async_init):
|
||||||
"""Test that parameter specs can be registered with flow processors"""
|
"""Test that parameter specs can be registered with flow processors"""
|
||||||
# Arrange
|
# Arrange
|
||||||
mock_async_init.return_value = None
|
def mock_init(self, **kwargs):
|
||||||
|
self.config_handlers = [] # Initialize required attribute
|
||||||
|
mock_async_init.side_effect = mock_init
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'id': 'test-flow-processor',
|
'id': 'test-flow-processor',
|
||||||
|
|
@ -50,7 +52,9 @@ class TestFlowParameterSpecs(IsolatedAsyncioTestCase):
|
||||||
def test_mixed_specification_types(self, mock_async_init):
|
def test_mixed_specification_types(self, mock_async_init):
|
||||||
"""Test registration of mixed specification types (parameters, consumers, producers)"""
|
"""Test registration of mixed specification types (parameters, consumers, producers)"""
|
||||||
# Arrange
|
# Arrange
|
||||||
mock_async_init.return_value = None
|
def mock_init(self, **kwargs):
|
||||||
|
self.config_handlers = [] # Initialize required attribute
|
||||||
|
mock_async_init.side_effect = mock_init
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'id': 'test-flow-processor',
|
'id': 'test-flow-processor',
|
||||||
|
|
@ -85,7 +89,9 @@ class TestFlowParameterSpecs(IsolatedAsyncioTestCase):
|
||||||
def test_parameter_spec_metadata(self, mock_async_init):
|
def test_parameter_spec_metadata(self, mock_async_init):
|
||||||
"""Test parameter specification metadata handling"""
|
"""Test parameter specification metadata handling"""
|
||||||
# Arrange
|
# Arrange
|
||||||
mock_async_init.return_value = None
|
def mock_init(self, **kwargs):
|
||||||
|
self.config_handlers = [] # Initialize required attribute
|
||||||
|
mock_async_init.side_effect = mock_init
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'id': 'test-flow-processor',
|
'id': 'test-flow-processor',
|
||||||
|
|
@ -118,7 +124,9 @@ class TestFlowParameterSpecs(IsolatedAsyncioTestCase):
|
||||||
def test_duplicate_parameter_spec_handling(self, mock_async_init):
|
def test_duplicate_parameter_spec_handling(self, mock_async_init):
|
||||||
"""Test handling of duplicate parameter spec registration"""
|
"""Test handling of duplicate parameter spec registration"""
|
||||||
# Arrange
|
# Arrange
|
||||||
mock_async_init.return_value = None
|
def mock_init(self, **kwargs):
|
||||||
|
self.config_handlers = [] # Initialize required attribute
|
||||||
|
mock_async_init.side_effect = mock_init
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'id': 'test-flow-processor',
|
'id': 'test-flow-processor',
|
||||||
|
|
@ -147,7 +155,9 @@ class TestFlowParameterSpecs(IsolatedAsyncioTestCase):
|
||||||
async def test_parameter_specs_available_to_flows(self, mock_async_init, mock_flow_class):
|
async def test_parameter_specs_available_to_flows(self, mock_async_init, mock_flow_class):
|
||||||
"""Test that parameter specs are available when flows are created"""
|
"""Test that parameter specs are available when flows are created"""
|
||||||
# Arrange
|
# Arrange
|
||||||
mock_async_init.return_value = None
|
def mock_init(self, **kwargs):
|
||||||
|
self.config_handlers = [] # Initialize required attribute
|
||||||
|
mock_async_init.side_effect = mock_init
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'id': 'test-flow-processor',
|
'id': 'test-flow-processor',
|
||||||
|
|
@ -187,7 +197,9 @@ class TestParameterSpecValidation(IsolatedAsyncioTestCase):
|
||||||
def test_parameter_spec_name_validation(self, mock_async_init):
|
def test_parameter_spec_name_validation(self, mock_async_init):
|
||||||
"""Test parameter spec name validation"""
|
"""Test parameter spec name validation"""
|
||||||
# Arrange
|
# Arrange
|
||||||
mock_async_init.return_value = None
|
def mock_init(self, **kwargs):
|
||||||
|
self.config_handlers = [] # Initialize required attribute
|
||||||
|
mock_async_init.side_effect = mock_init
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'id': 'test-flow-processor',
|
'id': 'test-flow-processor',
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,9 @@ class TestLlmServiceParameters(IsolatedAsyncioTestCase):
|
||||||
def test_parameter_specs_registration(self, mock_async_init):
|
def test_parameter_specs_registration(self, mock_async_init):
|
||||||
"""Test that LLM service registers model and temperature parameter specs"""
|
"""Test that LLM service registers model and temperature parameter specs"""
|
||||||
# Arrange
|
# Arrange
|
||||||
mock_async_init.return_value = None
|
def mock_init(self, **kwargs):
|
||||||
|
self.config_handlers = [] # Initialize required attribute
|
||||||
|
mock_async_init.side_effect = mock_init
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'id': 'test-llm-service',
|
'id': 'test-llm-service',
|
||||||
|
|
@ -40,7 +42,9 @@ class TestLlmServiceParameters(IsolatedAsyncioTestCase):
|
||||||
def test_model_parameter_spec_properties(self, mock_async_init):
|
def test_model_parameter_spec_properties(self, mock_async_init):
|
||||||
"""Test that model parameter spec has correct properties"""
|
"""Test that model parameter spec has correct properties"""
|
||||||
# Arrange
|
# Arrange
|
||||||
mock_async_init.return_value = None
|
def mock_init(self, **kwargs):
|
||||||
|
self.config_handlers = [] # Initialize required attribute
|
||||||
|
mock_async_init.side_effect = mock_init
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'id': 'test-llm-service',
|
'id': 'test-llm-service',
|
||||||
|
|
@ -64,7 +68,9 @@ class TestLlmServiceParameters(IsolatedAsyncioTestCase):
|
||||||
def test_temperature_parameter_spec_properties(self, mock_async_init):
|
def test_temperature_parameter_spec_properties(self, mock_async_init):
|
||||||
"""Test that temperature parameter spec has correct properties"""
|
"""Test that temperature parameter spec has correct properties"""
|
||||||
# Arrange
|
# Arrange
|
||||||
mock_async_init.return_value = None
|
def mock_init(self, **kwargs):
|
||||||
|
self.config_handlers = [] # Initialize required attribute
|
||||||
|
mock_async_init.side_effect = mock_init
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'id': 'test-llm-service',
|
'id': 'test-llm-service',
|
||||||
|
|
@ -88,7 +94,9 @@ class TestLlmServiceParameters(IsolatedAsyncioTestCase):
|
||||||
async def test_on_request_extracts_parameters_from_flow(self, mock_async_init):
|
async def test_on_request_extracts_parameters_from_flow(self, mock_async_init):
|
||||||
"""Test that on_request method extracts model and temperature from flow"""
|
"""Test that on_request method extracts model and temperature from flow"""
|
||||||
# Arrange
|
# Arrange
|
||||||
mock_async_init.return_value = None
|
def mock_init(self, **kwargs):
|
||||||
|
self.config_handlers = [] # Initialize required attribute
|
||||||
|
mock_async_init.side_effect = mock_init
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'id': 'test-llm-service',
|
'id': 'test-llm-service',
|
||||||
|
|
@ -147,7 +155,9 @@ class TestLlmServiceParameters(IsolatedAsyncioTestCase):
|
||||||
async def test_on_request_handles_missing_parameters_gracefully(self, mock_async_init):
|
async def test_on_request_handles_missing_parameters_gracefully(self, mock_async_init):
|
||||||
"""Test that on_request handles missing parameters gracefully"""
|
"""Test that on_request handles missing parameters gracefully"""
|
||||||
# Arrange
|
# Arrange
|
||||||
mock_async_init.return_value = None
|
def mock_init(self, **kwargs):
|
||||||
|
self.config_handlers = [] # Initialize required attribute
|
||||||
|
mock_async_init.side_effect = mock_init
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'id': 'test-llm-service',
|
'id': 'test-llm-service',
|
||||||
|
|
@ -198,7 +208,9 @@ class TestLlmServiceParameters(IsolatedAsyncioTestCase):
|
||||||
async def test_on_request_error_handling_preserves_behavior(self, mock_async_init):
|
async def test_on_request_error_handling_preserves_behavior(self, mock_async_init):
|
||||||
"""Test that parameter extraction doesn't break existing error handling"""
|
"""Test that parameter extraction doesn't break existing error handling"""
|
||||||
# Arrange
|
# Arrange
|
||||||
mock_async_init.return_value = None
|
def mock_init(self, **kwargs):
|
||||||
|
self.config_handlers = [] # Initialize required attribute
|
||||||
|
mock_async_init.side_effect = mock_init
|
||||||
|
|
||||||
config = {
|
config = {
|
||||||
'id': 'test-llm-service',
|
'id': 'test-llm-service',
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue