@@ -36,17 +36,64 @@ async def test_update(self, mock_async_client: AsyncMock, scenario_view: MockSce
3636 mock_async_client .scenarios .update = AsyncMock (return_value = scenario_view )
3737
3838 scenario = AsyncScenario (mock_async_client , "scn_123" )
39- result = await scenario .update (name = "new-name" , metadata = {"key" : "value" })
39+ result = await scenario .update (
40+ name = "updated-scenario" ,
41+ metadata = {"env" : "test" },
42+ environment_parameters = {
43+ "blueprint_id" : "bp_456" ,
44+ },
45+ input_context = {
46+ "problem_statement" : "Updated problem statement" ,
47+ },
48+ reference_output = "--- a/main.py\n +++ b/main.py\n @@ -1 +1 @@\n -old\n +new" ,
49+ required_environment_variables = ["API_KEY" , "DEBUG" ],
50+ required_secret_names = ["DB_PASSWORD" , "JWT_SECRET" ],
51+ scoring_contract = {
52+ "scoring_function_parameters" : [
53+ {
54+ "name" : "test-scorer" ,
55+ "scorer" : {
56+ "type" : "command_scorer" ,
57+ "command" : "echo 'score=1.0'" ,
58+ },
59+ "weight" : 1.0 ,
60+ }
61+ ],
62+ },
63+ validation_type = "FORWARD" ,
64+ )
4065
4166 assert result == scenario_view
4267 mock_async_client .scenarios .update .assert_awaited_once_with (
4368 "scn_123" ,
44- name = "new-name" ,
45- metadata = {"key" : "value" },
69+ name = "updated-scenario" ,
70+ metadata = {"env" : "test" },
71+ environment_parameters = {
72+ "blueprint_id" : "bp_456" ,
73+ },
74+ input_context = {
75+ "problem_statement" : "Updated problem statement" ,
76+ },
77+ reference_output = "--- a/main.py\n +++ b/main.py\n @@ -1 +1 @@\n -old\n +new" ,
78+ required_environment_variables = ["API_KEY" , "DEBUG" ],
79+ required_secret_names = ["DB_PASSWORD" , "JWT_SECRET" ],
80+ scoring_contract = {
81+ "scoring_function_parameters" : [
82+ {
83+ "name" : "test-scorer" ,
84+ "scorer" : {
85+ "type" : "command_scorer" ,
86+ "command" : "echo 'score=1.0'" ,
87+ },
88+ "weight" : 1.0 ,
89+ }
90+ ],
91+ },
92+ validation_type = "FORWARD" ,
4693 )
4794
48- async def test_run (self , mock_async_client : AsyncMock , scenario_run_view : MockScenarioRunView ) -> None :
49- """Test run method returns AsyncScenarioRun wrapper."""
95+ async def test_run_async (self , mock_async_client : AsyncMock , scenario_run_view : MockScenarioRunView ) -> None :
96+ """Test run_async method returns AsyncScenarioRun wrapper."""
5097 mock_async_client .scenarios .start_run = AsyncMock (return_value = scenario_run_view )
5198
5299 scenario = AsyncScenario (mock_async_client , "scn_123" )
@@ -59,10 +106,8 @@ async def test_run(self, mock_async_client: AsyncMock, scenario_run_view: MockSc
59106 run_name = "test-run" ,
60107 )
61108
62- async def test_run_and_await_env_ready (
63- self , mock_async_client : AsyncMock , scenario_run_view : MockScenarioRunView
64- ) -> None :
65- """Test run_and_await_env_ready method."""
109+ async def test_run (self , mock_async_client : AsyncMock , scenario_run_view : MockScenarioRunView ) -> None :
110+ """Test run method."""
66111 mock_async_client .scenarios .start_run_and_await_env_ready = AsyncMock (return_value = scenario_run_view )
67112
68113 scenario = AsyncScenario (mock_async_client , "scn_123" )
0 commit comments