Skip to content

Commit

Permalink
add command test
Browse files Browse the repository at this point in the history
  • Loading branch information
TamarZanzouri committed May 7, 2024
1 parent b57b38c commit d89186c
Showing 1 changed file with 43 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,3 +120,46 @@ def test_build_run_orchestrator_provider(
# fixit_runner=mock_fixit_runner,
# json_or_python_runner=mock_protocol_runner,
# )


@pytest.mark.parametrize(
"runner, command_intent, input_protocol_config",
[
(
lazy_fixture("mock_setup_runner"),
pe_commands.CommandIntent.SETUP,
None
),
(
lazy_fixture("mock_fixit_runner"),
pe_commands.CommandIntent.FIXIT,
None
),
(
lazy_fixture("mock_json_runner"),
pe_commands.CommandIntent.PROTOCOL,
JsonProtocolConfig(schema_version=7)
),
(
lazy_fixture("mock_python_runner"),
pe_commands.CommandIntent.PROTOCOL,
PythonProtocolConfig(api_version=2.14)
),
],
)
def test_add_command(
subject: RunOrchestrator,
decoy: Decoy,
runner: AnyRunner,
command_intent: pe_commands.CommandIntent,
input_protocol_config: Optional[Union[PythonProtocolConfig, JsonProtocolConfig]]
) -> None:
"""Should verify calls to set_command_queued."""
command_to_queue = pe_commands.HomeCreate.construct(
intent=command_intent, params=pe_commands.HomeParams.construct()
)
subject.build_orchestrator(protocol_config=input_protocol_config)
subject.add_command(command_to_queue)

decoy.verify(runner.set_command_queued(command_to_queue))

0 comments on commit d89186c

Please sign in to comment.