Fix tests

This commit is contained in:
Cyber MacGeddon 2025-09-25 23:57:08 +01:00
parent 12fadd0ad6
commit ba07704c62
2 changed files with 24 additions and 18 deletions

View file

@ -18,8 +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
def mock_init(self, **kwargs): def mock_init(*args, **kwargs):
self.config_handlers = [] # Initialize required attribute # args[0] is 'self', initialize the required attribute
args[0].config_handlers = []
mock_async_init.side_effect = mock_init mock_async_init.side_effect = mock_init
config = { config = {
@ -52,8 +53,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
def mock_init(self, **kwargs): def mock_init(*args, **kwargs):
self.config_handlers = [] # Initialize required attribute # args[0] is 'self', initialize the required attribute
args[0].config_handlers = []
mock_async_init.side_effect = mock_init mock_async_init.side_effect = mock_init
config = { config = {
@ -89,8 +91,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
def mock_init(self, **kwargs): def mock_init(*args, **kwargs):
self.config_handlers = [] # Initialize required attribute # args[0] is 'self', initialize the required attribute
args[0].config_handlers = []
mock_async_init.side_effect = mock_init mock_async_init.side_effect = mock_init
config = { config = {
@ -124,8 +127,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
def mock_init(self, **kwargs): def mock_init(*args, **kwargs):
self.config_handlers = [] # Initialize required attribute # args[0] is 'self', initialize the required attribute
args[0].config_handlers = []
mock_async_init.side_effect = mock_init mock_async_init.side_effect = mock_init
config = { config = {
@ -155,8 +159,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
def mock_init(self, **kwargs): def mock_init(*args, **kwargs):
self.config_handlers = [] # Initialize required attribute # args[0] is 'self', initialize the required attribute
args[0].config_handlers = []
mock_async_init.side_effect = mock_init mock_async_init.side_effect = mock_init
config = { config = {
@ -197,8 +202,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
def mock_init(self, **kwargs): def mock_init(*args, **kwargs):
self.config_handlers = [] # Initialize required attribute # args[0] is 'self', initialize the required attribute
args[0].config_handlers = []
mock_async_init.side_effect = mock_init mock_async_init.side_effect = mock_init
config = { config = {

View file

@ -19,7 +19,7 @@ class TestLlmServiceParameters(IsolatedAsyncioTestCase):
"""Test that LLM service registers model and temperature parameter specs""" """Test that LLM service registers model and temperature parameter specs"""
# Arrange # Arrange
def mock_init(self, **kwargs): def mock_init(self, **kwargs):
self.config_handlers = [] # Initialize required attribute self.config_handlers = []
mock_async_init.side_effect = mock_init mock_async_init.side_effect = mock_init
config = { config = {
@ -43,7 +43,7 @@ class TestLlmServiceParameters(IsolatedAsyncioTestCase):
"""Test that model parameter spec has correct properties""" """Test that model parameter spec has correct properties"""
# Arrange # Arrange
def mock_init(self, **kwargs): def mock_init(self, **kwargs):
self.config_handlers = [] # Initialize required attribute self.config_handlers = []
mock_async_init.side_effect = mock_init mock_async_init.side_effect = mock_init
config = { config = {
@ -69,7 +69,7 @@ class TestLlmServiceParameters(IsolatedAsyncioTestCase):
"""Test that temperature parameter spec has correct properties""" """Test that temperature parameter spec has correct properties"""
# Arrange # Arrange
def mock_init(self, **kwargs): def mock_init(self, **kwargs):
self.config_handlers = [] # Initialize required attribute self.config_handlers = []
mock_async_init.side_effect = mock_init mock_async_init.side_effect = mock_init
config = { config = {
@ -95,7 +95,7 @@ class TestLlmServiceParameters(IsolatedAsyncioTestCase):
"""Test that on_request method extracts model and temperature from flow""" """Test that on_request method extracts model and temperature from flow"""
# Arrange # Arrange
def mock_init(self, **kwargs): def mock_init(self, **kwargs):
self.config_handlers = [] # Initialize required attribute self.config_handlers = []
mock_async_init.side_effect = mock_init mock_async_init.side_effect = mock_init
config = { config = {
@ -156,7 +156,7 @@ class TestLlmServiceParameters(IsolatedAsyncioTestCase):
"""Test that on_request handles missing parameters gracefully""" """Test that on_request handles missing parameters gracefully"""
# Arrange # Arrange
def mock_init(self, **kwargs): def mock_init(self, **kwargs):
self.config_handlers = [] # Initialize required attribute self.config_handlers = []
mock_async_init.side_effect = mock_init mock_async_init.side_effect = mock_init
config = { config = {
@ -209,7 +209,7 @@ class TestLlmServiceParameters(IsolatedAsyncioTestCase):
"""Test that parameter extraction doesn't break existing error handling""" """Test that parameter extraction doesn't break existing error handling"""
# Arrange # Arrange
def mock_init(self, **kwargs): def mock_init(self, **kwargs):
self.config_handlers = [] # Initialize required attribute self.config_handlers = []
mock_async_init.side_effect = mock_init mock_async_init.side_effect = mock_init
config = { config = {