From aa98607445d67a1cb5d0571e4daad4a80a7834b6 Mon Sep 17 00:00:00 2001 From: Jakub Wlodek Date: Thu, 19 Sep 2024 18:05:23 -0400 Subject: [PATCH] Fix tests for remaining detectors to account for new changes to factory fixture --- tests/epics/adaravis/test_aravis.py | 10 +--------- tests/epics/adkinetix/test_kinetix.py | 11 ++--------- tests/epics/advimba/test_vimba.py | 11 ++--------- 3 files changed, 5 insertions(+), 27 deletions(-) diff --git a/tests/epics/adaravis/test_aravis.py b/tests/epics/adaravis/test_aravis.py index 341ad280ed..ee40fd6fc5 100644 --- a/tests/epics/adaravis/test_aravis.py +++ b/tests/epics/adaravis/test_aravis.py @@ -83,9 +83,6 @@ async def test_can_read(test_adaravis: adaravis.AravisDetector): async def test_decribe_describes_writer_dataset( test_adaravis: adaravis.AravisDetector, one_shot_trigger_info: TriggerInfo ): - set_mock_value(test_adaravis._writer.hdf.file_path_exists, True) - set_mock_value(test_adaravis._writer.hdf.capture, True) - assert await test_adaravis.describe() == {} await test_adaravis.stage() await test_adaravis.prepare(one_shot_trigger_info) @@ -106,10 +103,7 @@ async def test_can_collect( one_shot_trigger_info: TriggerInfo, ): path_info = static_path_provider() - full_file_name = path_info.directory_path / "foo.h5" - set_mock_value(test_adaravis.hdf.full_file_name, str(full_file_name)) - set_mock_value(test_adaravis._writer.hdf.file_path_exists, True) - set_mock_value(test_adaravis._writer.hdf.capture, True) + full_file_name = path_info.directory_path / f"{path_info.filename}.h5" await test_adaravis.stage() await test_adaravis.prepare(one_shot_trigger_info) docs = [(name, doc) async for name, doc in test_adaravis.collect_asset_docs(1)] @@ -135,8 +129,6 @@ async def test_can_collect( async def test_can_decribe_collect( test_adaravis: adaravis.AravisDetector, one_shot_trigger_info: TriggerInfo ): - set_mock_value(test_adaravis._writer.hdf.file_path_exists, True) - set_mock_value(test_adaravis._writer.hdf.capture, True) assert (await test_adaravis.describe_collect()) == {} await test_adaravis.stage() await test_adaravis.prepare(one_shot_trigger_info) diff --git a/tests/epics/adkinetix/test_kinetix.py b/tests/epics/adkinetix/test_kinetix.py index ae2f72462e..64e5c02f69 100644 --- a/tests/epics/adkinetix/test_kinetix.py +++ b/tests/epics/adkinetix/test_kinetix.py @@ -62,9 +62,6 @@ async def test_can_read(test_adkinetix: adkinetix.KinetixDetector): async def test_decribe_describes_writer_dataset( test_adkinetix: adkinetix.KinetixDetector, one_shot_trigger_info: TriggerInfo ): - set_mock_value(test_adkinetix._writer.hdf.file_path_exists, True) - set_mock_value(test_adkinetix._writer.hdf.capture, True) - assert await test_adkinetix.describe() == {} await test_adkinetix.stage() await test_adkinetix.prepare(one_shot_trigger_info) @@ -85,10 +82,8 @@ async def test_can_collect( one_shot_trigger_info: TriggerInfo, ): path_info = static_path_provider() - full_file_name = path_info.directory_path / "foo.h5" - set_mock_value(test_adkinetix.hdf.full_file_name, str(full_file_name)) - set_mock_value(test_adkinetix._writer.hdf.file_path_exists, True) - set_mock_value(test_adkinetix._writer.hdf.capture, True) + full_file_name = path_info.directory_path / f"{path_info.filename}.h5" + await test_adkinetix.stage() await test_adkinetix.prepare(one_shot_trigger_info) docs = [(name, doc) async for name, doc in test_adkinetix.collect_asset_docs(1)] @@ -114,8 +109,6 @@ async def test_can_collect( async def test_can_decribe_collect( test_adkinetix: adkinetix.KinetixDetector, one_shot_trigger_info: TriggerInfo ): - set_mock_value(test_adkinetix._writer.hdf.file_path_exists, True) - set_mock_value(test_adkinetix._writer.hdf.capture, True) assert (await test_adkinetix.describe_collect()) == {} await test_adkinetix.stage() await test_adkinetix.prepare(one_shot_trigger_info) diff --git a/tests/epics/advimba/test_vimba.py b/tests/epics/advimba/test_vimba.py index a8990502c3..80c9896f30 100644 --- a/tests/epics/advimba/test_vimba.py +++ b/tests/epics/advimba/test_vimba.py @@ -76,9 +76,6 @@ async def test_can_read(test_advimba: advimba.VimbaDetector): async def test_decribe_describes_writer_dataset( test_advimba: advimba.VimbaDetector, one_shot_trigger_info: TriggerInfo ): - set_mock_value(test_advimba._writer.hdf.file_path_exists, True) - set_mock_value(test_advimba._writer.hdf.capture, True) - assert await test_advimba.describe() == {} await test_advimba.stage() await test_advimba.prepare(one_shot_trigger_info) @@ -99,10 +96,8 @@ async def test_can_collect( one_shot_trigger_info: TriggerInfo, ): path_info = static_path_provider() - full_file_name = path_info.directory_path / "foo.h5" - set_mock_value(test_advimba.hdf.full_file_name, str(full_file_name)) - set_mock_value(test_advimba._writer.hdf.file_path_exists, True) - set_mock_value(test_advimba._writer.hdf.capture, True) + full_file_name = path_info.directory_path / f"{path_info.filename}.h5" + await test_advimba.stage() await test_advimba.prepare(one_shot_trigger_info) docs = [(name, doc) async for name, doc in test_advimba.collect_asset_docs(1)] @@ -128,8 +123,6 @@ async def test_can_collect( async def test_can_decribe_collect( test_advimba: advimba.VimbaDetector, one_shot_trigger_info: TriggerInfo ): - set_mock_value(test_advimba._writer.hdf.file_path_exists, True) - set_mock_value(test_advimba._writer.hdf.capture, True) assert (await test_advimba.describe_collect()) == {} await test_advimba.stage() await test_advimba.prepare(one_shot_trigger_info)