Skip to content

Commit

Permalink
I'm sorry, Mike.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Mar 26, 2024
1 parent cb3d655 commit 7c48aca
Showing 1 changed file with 26 additions and 13 deletions.
39 changes: 26 additions & 13 deletions api/tests/opentrons/protocol_runner/test_protocol_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -478,20 +478,27 @@ async def test_load_legacy_python(
run_time_param_values=None,
)

run_func_captor = matchers.Captor()

decoy.verify(
protocol_engine.add_labware_definition(labware_definition),
protocol_engine.add_plugin(matchers.IsA(LegacyContextPlugin)),
protocol_engine.add_command(
task_queue.set_run_func(run_func_captor),
)

assert broker_captor.value is legacy_python_runner_subject.broker

# Verify that the run func calls the right things:
run_func = run_func_captor.value
await run_func()
decoy.verify(
await protocol_engine.add_and_execute_command(
request=pe_commands.HomeCreate(params=pe_commands.HomeParams(axes=None))
),
task_queue.set_run_func(
func=legacy_executor.execute,
protocol=legacy_protocol,
context=legacy_context,
run_time_param_values=None,
await legacy_executor.execute(
protocol=legacy_protocol, context=legacy_context, run_time_param_values=None
),
)
assert broker_captor.value is legacy_python_runner_subject.broker


async def test_load_python_with_pe_papi_core(
Expand Down Expand Up @@ -612,17 +619,23 @@ async def test_load_legacy_json(
run_time_param_values=None,
)

run_func_captor = matchers.Captor()

decoy.verify(
protocol_engine.add_labware_definition(labware_definition),
protocol_engine.add_plugin(matchers.IsA(LegacyContextPlugin)),
protocol_engine.add_command(
task_queue.set_run_func(run_func_captor),
)

# Verify that the run func calls the right things:
run_func = run_func_captor.value
await run_func()
decoy.verify(
await protocol_engine.add_and_execute_command(
request=pe_commands.HomeCreate(params=pe_commands.HomeParams(axes=None))
),
task_queue.set_run_func(
func=legacy_executor.execute,
protocol=legacy_protocol,
context=legacy_context,
run_time_param_values=None,
await legacy_executor.execute(
protocol=legacy_protocol, context=legacy_context, run_time_param_values=None
),
)

Expand Down

0 comments on commit 7c48aca

Please sign in to comment.