@@ -62,13 +62,15 @@ async def create(self, messages, extra_create_args=None):
6262 dummy_resp .content = json .dumps (response_dict )
6363 return dummy_resp
6464
65+
6566class DummyModelClientError (AzureOpenAIChatCompletionClient ):
6667 def __init__ (self , ** kwargs ):
6768 pass
6869
6970 async def create (self , messages , extra_create_args = None ):
7071 raise Exception ("LLM error" )
7172
73+
7274class DummyModelClientInvalidJSON (AzureOpenAIChatCompletionClient ):
7375 def __init__ (self , ** kwargs ):
7476 pass
@@ -78,6 +80,7 @@ async def create(self, messages, extra_create_args=None):
7880 dummy_resp .content = "invalid json"
7981 return dummy_resp
8082
83+
8184# Fixture: a dummy Step for testing.
8285@pytest .fixture
8386def dummy_step ():
@@ -97,8 +100,8 @@ def dummy_step():
97100 step .__pydantic_extra__ = {}
98101 return step
99102
100- # Tests for extract_and_update_transition_states
101103
104+ # Tests for extract_and_update_transition_states
102105@pytest .mark .asyncio
103106async def test_extract_and_update_transition_states_success (dummy_step ):
104107 """
@@ -167,10 +170,10 @@ def test_dummy_json_parsing():
167170 """
168171 json_str = '{"identifiedTargetState": "TestState", "identifiedTargetTransition": "TestTransition"}'
169172 data = json .loads (json_str )
173+
170174 class DummySchema (BaseModel ):
171175 identifiedTargetState : str
172176 identifiedTargetTransition : str
173177 schema = DummySchema (** data )
174178 assert schema .identifiedTargetState == "TestState"
175179 assert schema .identifiedTargetTransition == "TestTransition"
176-
0 commit comments