Revert "fix(deprecation): remove all remaining .dumps(), .loads() and producer->connector"

This reverts commit 4159f3e3ec
This commit is contained in:
2024-02-17 17:44:52 +01:00
parent 257b1fa466
commit b12292246f
18 changed files with 88 additions and 81 deletions

View File

@ -28,7 +28,7 @@ def mock_det():
prefix = "X12SA-ES-PILATUS300K:"
sim_mode = False
dm = DMMock()
with mock.patch.object(dm, "connector"):
with mock.patch.object(dm, "producer"):
with mock.patch(
"ophyd_devices.epics.devices.psi_detector_base.FileWriterMixin"
), mock.patch(
@ -207,27 +207,27 @@ def test_publish_file_location(mock_det, scaninfo):
file_path=scaninfo["filepath"],
done=scaninfo["done"],
metadata={"input_path": scaninfo["filepath_raw"]},
)
).dumps()
else:
msg = messages.FileMessage(
file_path=scaninfo["filepath"],
done=scaninfo["done"],
metadata={"input_path": scaninfo["filepath_raw"]},
successful=scaninfo["successful"],
)
).dumps()
expected_calls = [
mock.call(
MessageEndpoints.public_file(scaninfo["scanID"], mock_det.name),
msg,
pipe=mock_det.connector.pipeline.return_value,
pipe=mock_det.producer.pipeline.return_value,
),
mock.call(
MessageEndpoints.file_event(mock_det.name),
msg,
pipe=mock_det.connector.pipeline.return_value,
pipe=mock_det.producer.pipeline.return_value,
),
]
assert mock_det.connector.set_and_publish.call_args_list == expected_calls
assert mock_det.producer.set_and_publish.call_args_list == expected_calls
@pytest.mark.parametrize(