Skip to content

Commit

Permalink
DiamondLightSource/hyperion#1192 fix some test fixtures
Browse files Browse the repository at this point in the history
  • Loading branch information
dperl-dls committed Feb 29, 2024
1 parent 7d1f9aa commit 1dc8844
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
from hyperion.log import LOGGER
from hyperion.parameters import external_parameters
from hyperion.parameters.constants import (
DO_FGS,
GRIDSCAN_AND_MOVE,
GRIDSCAN_MAIN_PLAN,
GRIDSCAN_OUTER_PLAN,
Expand Down Expand Up @@ -270,7 +271,7 @@ def panda_flyscan_xray_centre(
@bpp.run_decorator( # attach experiment metadata to the start document
md={
"subplan_name": GRIDSCAN_OUTER_PLAN,
"trigger_zocalo_on": GRIDSCAN_MAIN_PLAN,
"trigger_zocalo_on": DO_FGS,
"hyperion_internal_parameters": parameters.json(),
"activate_callbacks": [
"GridscanISPyBCallback",
Expand Down
3 changes: 2 additions & 1 deletion tests/unit_tests/experiment_plans/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
IspybIds,
)
from hyperion.parameters.constants import (
DO_FGS,
GRIDSCAN_OUTER_PLAN,
ISPYB_HARDWARE_READ_PLAN,
ISPYB_TRANSMISSION_FLUX_READ_PLAN,
Expand Down Expand Up @@ -152,9 +153,9 @@ def mock_subscriptions(test_fgs_params):
start_doc = {
"subplan_name": GRIDSCAN_OUTER_PLAN,
"hyperion_internal_parameters": test_fgs_params.json(),
"trigger_zocalo_on": DO_FGS,
}
subscriptions.ispyb_handler.activity_gated_start(start_doc)
subscriptions.zocalo_handler.activity_gated_start(start_doc)

return subscriptions

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,7 @@ def test_individual_plans_triggered_once_and_only_once_in_composite_run(
test_fgs_params: GridscanInternalParameters,
):
RE, mock_subscriptions = RE_with_subs
mock_subscriptions.zocalo_handler.activity_gated_start(
self.td.test_start_document
)

run_generic_ispyb_handler_setup(
mock_subscriptions.ispyb_handler, test_fgs_params
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -341,9 +341,6 @@ def test_individual_plans_triggered_once_and_only_once_in_composite_run(
fake_fgs_composite: FlyScanXRayCentreComposite,
test_panda_fgs_params: PandAGridscanInternalParameters,
):
mock_subscriptions.zocalo_handler.activity_gated_start(
self.td.test_start_document
)
run_generic_ispyb_handler_setup(
mock_subscriptions.ispyb_handler, test_panda_fgs_params
)
Expand Down Expand Up @@ -701,9 +698,6 @@ def test_when_grid_scan_ran_then_eiger_disarmed_before_zocalo_end(
fake_fgs_composite.xbpm_feedback.pos_stable.sim_put(1) # type: ignore

with patch(
"hyperion.experiment_plans.panda_flyscan_xray_centre_plan.XrayCentreCallbackCollection.setup",
lambda: mock_subscriptions,
), patch(
"hyperion.external_interaction.callbacks.xray_centre.nexus_callback.NexusWriter.create_nexus_file",
autospec=True,
), patch(
Expand Down

0 comments on commit 1dc8844

Please sign in to comment.