@@ -1016,24 +1016,23 @@ async def test_interact_with_trace_dependent_inputs(self):
10161016 assert result .final_trace .interactions [0 ].outputs == "Received: Message #1"
10171017
10181018
1019- class TestScenarioFromSequenceAndSerialization :
1020- """Test Scenario.from_sequence () and step-based serialization."""
1019+ class TestScenarioExtendAndSerialization :
1020+ """Test Scenario.extend () and step-based serialization."""
10211021
1022- async def test_from_sequence_equivalent_to_fluent_api (self ):
1023- """Scenario.from_sequence( ) produces same result as fluent API."""
1022+ async def test_extend_equivalent_to_fluent_api (self ):
1023+ """Scenario(...).extend(... ) produces same result as fluent API."""
10241024 fluent = (
10251025 Scenario ("fluent" )
10261026 .interact ("Hello" , "Hi" )
10271027 .check (Equals (expected_value = "Hi" , key = "trace.last.outputs" ))
10281028 .interact ("World" , "Echo: World" )
10291029 .check (Equals (expected_value = "Echo: World" , key = "trace.last.outputs" ))
10301030 )
1031- from_seq = Scenario . from_sequence (
1031+ from_seq = Scenario ( name = "fluent" ). extend (
10321032 Interact (inputs = "Hello" , outputs = "Hi" ),
10331033 Equals (expected_value = "Hi" , key = "trace.last.outputs" ),
10341034 Interact (inputs = "World" , outputs = "Echo: World" ),
10351035 Equals (expected_value = "Echo: World" , key = "trace.last.outputs" ),
1036- name = "fluent" ,
10371036 )
10381037
10391038 result_fluent = await fluent .run ()
@@ -1045,10 +1044,10 @@ async def test_from_sequence_equivalent_to_fluent_api(self):
10451044 result_from_seq .final_trace .interactions
10461045 )
10471046
1048- async def test_from_sequence_with_only_checks (self ):
1049- """from_sequence handles scenario starting with checks only."""
1047+ async def test_extend_with_only_checks (self ):
1048+ """extend handles scenario starting with checks only."""
10501049 check = MockCheck (result = CheckResult .success (message = "OK" ))
1051- scenario = Scenario . from_sequence ( check , name = "checks_only" )
1050+ scenario = Scenario ( name = "checks_only" ). extend ( check )
10521051 result = await scenario .run ()
10531052 assert result .passed
10541053 assert len (result .steps ) == 1
0 commit comments