Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@ def __init__(self, changeConfigurationPort: ChangeConfigurationPort):
self.outport = changeConfigurationPort

def changeLLMModel(self, LLModel:LLMModelType ) -> ConfigurationOperationResponse:
return self.outport.changeLLMModel(LLModel)

return self.outport.changeLLMModel(LLModel)
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import unittest.mock
from application.service.change_configuration_service import ChangeConfigurationService
from domain.configuration.llm_model_configuration import LLMModelType
from domain.configuration.configuration_operation_response import ConfigurationOperationResponse

def test_changeConfiguration():
with unittest.mock.patch('application.service.change_configuration_service.ChangeConfigurationPort') as changeConfigurationPortMock:
changeConfigurationPortMock.changeLLMModel.return_value = ConfigurationOperationResponse(True, "Model changed successfully")
# outPortMock = mocker.Mock()
# outPortMock.changeLLMModel.return_value = ConfigurationOperationResponse(True, "Model changed successfully")

# changeConfigurationService = ChangeConfigurationService(outPortMock)
changeConfigurationService = ChangeConfigurationService(changeConfigurationPortMock)

response = changeConfigurationService.changeLLMModel(LLMModelType.OPENAI)

# outPortMock.changeLLMModel.assert_called_once_with(LLMModelType.OPENAI)
changeConfigurationPortMock.changeLLMModel.assert_called_once_with(LLMModelType.OPENAI)

assert isinstance(response, ConfigurationOperationResponse)