From e7cef5bebce8f079bf44fb842bb8a26bf2554fa3 Mon Sep 17 00:00:00 2001 From: Jakub Wlodek Date: Sat, 21 Sep 2024 08:49:57 -0400 Subject: [PATCH] Simplify ad standard det tests (#592) * Refactor ADPilatus tests to use the ad_standard_det_factory * Add default signals for sim detector config * Fix type annotation * Overhaul sim detector tests to use ad standard det factory, improve factory with mock put callback * Fix tests for remaining detectors to account for new changes to factory fixture * Make sure to include config_sigs passed to init * Add suggestions from review --- src/ophyd_async/epics/adsimdetector/_sim.py | 2 +- tests/conftest.py | 2 +- tests/epics/adaravis/test_aravis.py | 10 +- tests/epics/adkinetix/test_kinetix.py | 13 +- tests/epics/adpilatus/test_pilatus.py | 54 ++--- .../adpilatus/test_pilatus_controller.py | 46 ----- .../adsimdetector/test_adsim_controller.py | 32 --- tests/epics/adsimdetector/test_sim.py | 186 +++++++++--------- tests/epics/advimba/test_vimba.py | 13 +- tests/epics/conftest.py | 26 ++- 10 files changed, 154 insertions(+), 230 deletions(-) delete mode 100644 tests/epics/adpilatus/test_pilatus_controller.py delete mode 100644 tests/epics/adsimdetector/test_adsim_controller.py diff --git a/src/ophyd_async/epics/adsimdetector/_sim.py b/src/ophyd_async/epics/adsimdetector/_sim.py index 5a23b4774..acc640899 100644 --- a/src/ophyd_async/epics/adsimdetector/_sim.py +++ b/src/ophyd_async/epics/adsimdetector/_sim.py @@ -30,6 +30,6 @@ def __init__( lambda: self.name, adcore.ADBaseDatasetDescriber(self.drv), ), - config_sigs=config_sigs, + config_sigs=(self.drv.acquire_period, self.drv.acquire_time, *config_sigs), name=name, ) diff --git a/tests/conftest.py b/tests/conftest.py index d71738ae8..0dfd2c75c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -220,7 +220,7 @@ def create_static_dir_provider_given_fp(fp: FilenameProvider): @pytest.fixture def static_path_provider( - static_path_provider_factory: callable, + static_path_provider_factory: Callable, static_filename_provider: FilenameProvider, ): return static_path_provider_factory(static_filename_provider) diff --git a/tests/epics/adaravis/test_aravis.py b/tests/epics/adaravis/test_aravis.py index 341ad280e..ee40fd6fc 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 ae2f72462..5e460f63d 100644 --- a/tests/epics/adkinetix/test_kinetix.py +++ b/tests/epics/adkinetix/test_kinetix.py @@ -51,7 +51,7 @@ async def setup_trigger_mode(trig_mode: DetectorTrigger): async def test_hints_from_hdf_writer(test_adkinetix: adkinetix.KinetixDetector): - assert test_adkinetix.hints == {"fields": ["test_adkinetix1"]} + assert test_adkinetix.hints == {"fields": [test_adkinetix.name]} async def test_can_read(test_adkinetix: adkinetix.KinetixDetector): @@ -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/adpilatus/test_pilatus.py b/tests/epics/adpilatus/test_pilatus.py index 7d6145f5a..192c466a1 100644 --- a/tests/epics/adpilatus/test_pilatus.py +++ b/tests/epics/adpilatus/test_pilatus.py @@ -3,37 +3,24 @@ from unittest.mock import patch import pytest -from bluesky.run_engine import RunEngine from ophyd_async.core import ( DetectorTrigger, - DeviceCollector, - PathProvider, TriggerInfo, set_mock_value, ) -from ophyd_async.epics import adpilatus +from ophyd_async.epics import adcore, adpilatus @pytest.fixture -async def test_adpilatus( - RE: RunEngine, - static_path_provider: PathProvider, -) -> adpilatus.PilatusDetector: - async with DeviceCollector(mock=True): - test_adpilatus = adpilatus.PilatusDetector("PILATUS:", static_path_provider) - - return test_adpilatus - - -async def test_deadtime_overridable(static_path_provider: PathProvider): - async with DeviceCollector(mock=True): - test_adpilatus = adpilatus.PilatusDetector( - "PILATUS:", - static_path_provider, - readout_time=adpilatus.PilatusReadoutTime.pilatus2, - ) - pilatus_controller = test_adpilatus.controller +def test_adpilatus(ad_standard_det_factory) -> adpilatus.PilatusDetector: + return ad_standard_det_factory(adpilatus.PilatusDetector) + + +async def test_deadtime_overridable(test_adpilatus: adpilatus.PilatusDetector): + pilatus_controller = test_adpilatus._controller + pilatus_controller._readout_time = adpilatus.PilatusReadoutTime.pilatus2 + # deadtime invariant with exposure time assert pilatus_controller.get_deadtime(0) == 2.28e-3 @@ -110,7 +97,7 @@ async def _trigger( async def test_hints_from_hdf_writer(test_adpilatus: adpilatus.PilatusDetector): - assert test_adpilatus.hints == {"fields": ["test_adpilatus"]} + assert test_adpilatus.hints == {"fields": [test_adpilatus.name]} async def test_unsupported_trigger_excepts(test_adpilatus: adpilatus.PilatusDetector): @@ -144,3 +131,24 @@ async def dummy_open(multiplier: int = 0): ) assert (await test_adpilatus.drv.acquire_time.get_value()) == 1.0 assert (await test_adpilatus.drv.acquire_period.get_value()) == 1.0 + 950e-6 + + +async def test_pilatus_controller(test_adpilatus: adpilatus.PilatusDetector): + pilatus = test_adpilatus._controller + pilatus_driver = pilatus._drv + set_mock_value(pilatus_driver.armed, True) + await pilatus.prepare(TriggerInfo(number=1, trigger=DetectorTrigger.constant_gate)) + await pilatus.arm() + await pilatus.wait_for_idle() + + assert await pilatus_driver.num_images.get_value() == 1 + assert await pilatus_driver.image_mode.get_value() == adcore.ImageMode.multiple + assert ( + await pilatus_driver.trigger_mode.get_value() + == adpilatus.PilatusTriggerMode.ext_enable + ) + assert await pilatus_driver.acquire.get_value() is True + + await pilatus.disarm() + + assert await pilatus_driver.acquire.get_value() is False diff --git a/tests/epics/adpilatus/test_pilatus_controller.py b/tests/epics/adpilatus/test_pilatus_controller.py deleted file mode 100644 index bb825b874..000000000 --- a/tests/epics/adpilatus/test_pilatus_controller.py +++ /dev/null @@ -1,46 +0,0 @@ -import pytest - -from ophyd_async.core import DetectorTrigger, DeviceCollector, set_mock_value -from ophyd_async.core._detector import TriggerInfo -from ophyd_async.epics import adcore, adpilatus - - -@pytest.fixture -async def pilatus_driver(RE) -> adpilatus.PilatusDriverIO: - async with DeviceCollector(mock=True): - drv = adpilatus.PilatusDriverIO("DRIVER:") - - return drv - - -@pytest.fixture -async def pilatus( - RE, pilatus_driver: adpilatus.PilatusDriverIO -) -> adpilatus.PilatusController: - async with DeviceCollector(mock=True): - controller = adpilatus.PilatusController(pilatus_driver, readout_time=2.28) - - return controller - - -async def test_pilatus_controller( - RE, - pilatus: adpilatus.PilatusController, - pilatus_driver: adpilatus.PilatusDriverIO, -): - set_mock_value(pilatus_driver.armed, True) - await pilatus.prepare(TriggerInfo(number=1, trigger=DetectorTrigger.constant_gate)) - await pilatus.arm() - await pilatus.wait_for_idle() - - assert await pilatus_driver.num_images.get_value() == 1 - assert await pilatus_driver.image_mode.get_value() == adcore.ImageMode.multiple - assert ( - await pilatus_driver.trigger_mode.get_value() - == adpilatus.PilatusTriggerMode.ext_enable - ) - assert await pilatus_driver.acquire.get_value() is True - - await pilatus.disarm() - - assert await pilatus_driver.acquire.get_value() is False diff --git a/tests/epics/adsimdetector/test_adsim_controller.py b/tests/epics/adsimdetector/test_adsim_controller.py deleted file mode 100644 index 64d53ce59..000000000 --- a/tests/epics/adsimdetector/test_adsim_controller.py +++ /dev/null @@ -1,32 +0,0 @@ -from unittest.mock import patch - -import pytest - -from ophyd_async.core import DeviceCollector -from ophyd_async.core._detector import DetectorTrigger, TriggerInfo -from ophyd_async.epics import adcore, adsimdetector - - -@pytest.fixture -async def ad(RE) -> adsimdetector.SimController: - async with DeviceCollector(mock=True): - drv = adcore.ADBaseIO("DRIVER:") - controller = adsimdetector.SimController(drv) - - return controller - - -async def test_ad_controller(RE, ad: adsimdetector.SimController): - with patch("ophyd_async.core._signal.wait_for_value", return_value=None): - await ad.prepare(TriggerInfo(number=1, trigger=DetectorTrigger.internal)) - await ad.arm() - await ad.wait_for_idle() - - driver = ad.driver - assert await driver.num_images.get_value() == 1 - assert await driver.image_mode.get_value() == adcore.ImageMode.multiple - assert await driver.acquire.get_value() is True - - await ad.disarm() - - assert await driver.acquire.get_value() is False diff --git a/tests/epics/adsimdetector/test_sim.py b/tests/epics/adsimdetector/test_sim.py index fd99fd049..637c3c6ed 100644 --- a/tests/epics/adsimdetector/test_sim.py +++ b/tests/epics/adsimdetector/test_sim.py @@ -4,46 +4,40 @@ from collections import defaultdict from pathlib import Path from typing import cast +from unittest.mock import patch import bluesky.plan_stubs as bps import bluesky.preprocessors as bpp import pytest -from bluesky import RunEngine -from bluesky.utils import new_uid +from bluesky.run_engine import RunEngine import ophyd_async.plan_stubs as ops from ophyd_async.core import ( AsyncStatus, DetectorTrigger, - DeviceCollector, - StandardDetector, StaticFilenameProvider, StaticPathProvider, TriggerInfo, assert_emitted, - callback_on_mock_put, set_mock_value, ) from ophyd_async.epics import adcore, adsimdetector -async def make_detector(prefix: str, name: str, tmp_path: Path): - fp = StaticFilenameProvider(f"test-{new_uid()}") - dp = StaticPathProvider(fp, tmp_path) - - async with DeviceCollector(mock=True): - det = adsimdetector.SimDetector(prefix, dp, name=name) - det._config_sigs = [det.drv.acquire_time, det.drv.acquire] +@pytest.fixture +def test_adsimdetector(ad_standard_det_factory): + return ad_standard_det_factory(adsimdetector.SimDetector) - def _set_full_file_name(val, *args, **kwargs): - set_mock_value(det.hdf.full_file_name, str(tmp_path / val)) - callback_on_mock_put(det.hdf.file_name, _set_full_file_name) +@pytest.fixture +def two_test_adsimdetectors(ad_standard_det_factory): + deta = ad_standard_det_factory(adsimdetector.SimDetector) + detb = ad_standard_det_factory(adsimdetector.SimDetector, number=2) - return det + return deta, detb -def count_sim(dets: list[StandardDetector], times: int = 1): +def count_sim(dets: list[adsimdetector.SimDetector], times: int = 1): """Test plan to do the equivalent of bp.count for a sim detector.""" yield from bps.stage_all(*dets) @@ -79,38 +73,8 @@ def count_sim(dets: list[StandardDetector], times: int = 1): yield from bps.unstage_all(*dets) -@pytest.fixture -async def single_detector(RE: RunEngine, tmp_path: Path) -> StandardDetector: - detector = await make_detector(prefix="TEST:", name="test", tmp_path=tmp_path) - - set_mock_value(detector._controller.driver.array_size_x, 10) - set_mock_value(detector._controller.driver.array_size_y, 20) - return detector - - -@pytest.fixture -async def two_detectors(tmp_path: Path): - deta = await make_detector(prefix="PREFIX1:", name="testa", tmp_path=tmp_path) - detb = await make_detector(prefix="PREFIX2:", name="testb", tmp_path=tmp_path) - - # Simulate backend IOCs being in slightly different states - for i, det in enumerate((deta, detb)): - # accessing the hidden objects just for neat typing - controller = det._controller - writer = det._writer - - set_mock_value(controller.driver.acquire_time, 0.8 + i) - set_mock_value(controller.driver.image_mode, adcore.ImageMode.continuous) - set_mock_value(writer.hdf.num_capture, 1000) - set_mock_value(writer.hdf.num_captured, 0) - set_mock_value(writer.hdf.file_path_exists, True) - set_mock_value(controller.driver.array_size_x, 1024 + i) - set_mock_value(controller.driver.array_size_y, 768 + i) - yield deta, detb - - async def test_two_detectors_fly_different_rate( - two_detectors: list[adsimdetector.SimDetector], RE: RunEngine + two_test_adsimdetectors: list[adsimdetector.SimDetector], RE: RunEngine ): trigger_info = TriggerInfo( number=15, @@ -131,37 +95,37 @@ def assert_n_stream_datums( assert seq_nums["start"] == start assert seq_nums["stop"] == stop - @bpp.stage_decorator(two_detectors) + @bpp.stage_decorator(two_test_adsimdetectors) @bpp.run_decorator() def fly_plan(): - for det in two_detectors: + for det in two_test_adsimdetectors: yield from bps.prepare(det, trigger_info, wait=True, group="prepare") - yield from bps.declare_stream(*two_detectors, name="primary") + yield from bps.declare_stream(*two_test_adsimdetectors, name="primary") - for det in two_detectors: + for det in two_test_adsimdetectors: yield from bps.trigger(det, wait=False, group="trigger_cleanup") # det[0] captures 5 frames, but we do not emit a StreamDatum as det[1] has not - set_mock_value(two_detectors[0].hdf.num_captured, 5) + set_mock_value(two_test_adsimdetectors[0].hdf.num_captured, 5) - yield from bps.collect(*two_detectors) + yield from bps.collect(*two_test_adsimdetectors) assert_n_stream_datums(0) # det[0] captures 10 frames, but we do not emit a StreamDatum as det[1] has not - set_mock_value(two_detectors[0].hdf.num_captured, 10) - yield from bps.collect(*two_detectors) + set_mock_value(two_test_adsimdetectors[0].hdf.num_captured, 10) + yield from bps.collect(*two_test_adsimdetectors) assert_n_stream_datums(0) # det[1] has caught up to first 7 frames, emit streamDatum for seq_num {1,7} - set_mock_value(two_detectors[1].hdf.num_captured, 7) - yield from bps.collect(*two_detectors) + set_mock_value(two_test_adsimdetectors[1].hdf.num_captured, 7) + yield from bps.collect(*two_test_adsimdetectors) assert_n_stream_datums(2, 1, 8) - for det in two_detectors: + for det in two_test_adsimdetectors: set_mock_value(det.hdf.num_captured, 15) # emits stream datum for seq_num {8, 15} - yield from bps.collect(*two_detectors) + yield from bps.collect(*two_test_adsimdetectors) assert_n_stream_datums(4, 8, 16) # Trigger has complete as all expected frames written @@ -174,7 +138,7 @@ def fly_plan(): async def test_two_detectors_step( - two_detectors: list[StandardDetector], + two_test_adsimdetectors: list[adsimdetector.SimDetector], RE: RunEngine, ): names = [] @@ -183,20 +147,22 @@ async def test_two_detectors_step( RE.subscribe(lambda _, doc: docs.append(doc)) [ set_mock_value(cast(adcore.ADHDFWriter, det._writer).hdf.file_path_exists, True) - for det in two_detectors + for det in two_test_adsimdetectors ] - controller_a = cast(adsimdetector.SimController, two_detectors[0].controller) - writer_a = cast(adcore.ADHDFWriter, two_detectors[0].writer) - writer_b = cast(adcore.ADHDFWriter, two_detectors[1].writer) - info_a = writer_a._path_provider(device_name=writer_a.hdf.name) - info_b = writer_b._path_provider(device_name=writer_b.hdf.name) + controller_a = cast( + adsimdetector.SimController, two_test_adsimdetectors[0].controller + ) + writer_a = cast(adcore.ADHDFWriter, two_test_adsimdetectors[0].writer) + writer_b = cast(adcore.ADHDFWriter, two_test_adsimdetectors[1].writer) + info_a = writer_a._path_provider(device_name=writer_a._name_provider()) + info_b = writer_b._path_provider(device_name=writer_b._name_provider()) file_name_a = None file_name_b = None def plan(): nonlocal file_name_a, file_name_b - yield from count_sim(two_detectors, times=1) + yield from count_sim(two_test_adsimdetectors, times=1) drv = controller_a.driver assert False is (yield from bps.rd(drv.acquire)) @@ -229,38 +195,51 @@ def plan(): ] _, descriptor, sra, sda, srb, sdb, event, _ = docs - assert descriptor["configuration"]["testa"]["data"]["testa-drv-acquire_time"] == 0.8 - assert descriptor["configuration"]["testb"]["data"]["testb-drv-acquire_time"] == 1.8 - assert descriptor["data_keys"]["testa"]["shape"] == (768, 1024) - assert descriptor["data_keys"]["testb"]["shape"] == (769, 1025) + assert descriptor["configuration"]["test_adsim1"]["data"][ + "test_adsim1-drv-acquire_time" + ] == pytest.approx(0.8) + assert descriptor["configuration"]["test_adsim2"]["data"][ + "test_adsim2-drv-acquire_time" + ] == pytest.approx(1.8) + assert descriptor["data_keys"]["test_adsim1"]["shape"] == (10, 10) + assert descriptor["data_keys"]["test_adsim2"]["shape"] == (11, 11) assert sda["stream_resource"] == sra["uid"] assert sdb["stream_resource"] == srb["uid"] - assert srb["uri"] == "file://localhost" + str(info_b.directory_path / file_name_b) - assert sra["uri"] == "file://localhost" + str(info_a.directory_path / file_name_a) + assert ( + srb["uri"] + == "file://localhost" + str(info_b.directory_path / info_b.filename) + ".h5" + ) + assert ( + sra["uri"] + == "file://localhost" + str(info_a.directory_path / info_a.filename) + ".h5" + ) assert event["data"] == {} async def test_detector_writes_to_file( - RE: RunEngine, single_detector: StandardDetector, tmp_path: Path + RE: RunEngine, test_adsimdetector: adsimdetector.SimDetector, tmp_path: Path ): names = [] docs = [] RE.subscribe(lambda name, _: names.append(name)) RE.subscribe(lambda _, doc: docs.append(doc)) set_mock_value( - cast(adcore.ADHDFWriter, single_detector._writer).hdf.file_path_exists, True + cast(adcore.ADHDFWriter, test_adsimdetector._writer).hdf.file_path_exists, True ) - RE(count_sim([single_detector], times=3)) + RE(count_sim([test_adsimdetector], times=3)) assert await cast( - adcore.ADHDFWriter, single_detector.writer + adcore.ADHDFWriter, test_adsimdetector.writer ).hdf.file_path.get_value() == str(tmp_path) descriptor_index = names.index("descriptor") - assert docs[descriptor_index].get("data_keys").get("test").get("shape") == (20, 10) + assert docs[descriptor_index].get("data_keys").get("test_adsim1").get("shape") == ( + 10, + 10, + ) assert names == [ "start", "descriptor", @@ -275,39 +254,41 @@ async def test_detector_writes_to_file( ] -async def test_read_and_describe_detector(single_detector: StandardDetector): - describe = await single_detector.describe_configuration() - read = await single_detector.read_configuration() +async def test_read_and_describe_detector( + test_adsimdetector: adsimdetector.SimDetector, +): + describe = await test_adsimdetector.describe_configuration() + read = await test_adsimdetector.read_configuration() assert describe == { - "test-drv-acquire_time": { - "source": "mock+ca://TEST:cam1:AcquireTime_RBV", + "test_adsim1-drv-acquire_time": { + "source": "mock+ca://SIM1:cam1:AcquireTime_RBV", "dtype": "number", "dtype_numpy": " Callable: +) -> Callable[[StandardDetector, int], StandardDetector]: def generate_ad_standard_det( ad_standard_detector_class, number=1 ) -> StandardDetector: @@ -28,10 +29,27 @@ def generate_ad_standard_det( name=f"test_ad{detector_name.lower()}{number}", ) + def on_set_file_path_callback(value, **kwargs): + if os.path.exists(value): + set_mock_value(test_adstandard_det.hdf.file_path_exists, True) + set_mock_value( + test_adstandard_det.hdf.full_file_name, + f"{value}/{static_path_provider._filename_provider(device_name=test_adstandard_det.name)}.h5", + ) + + callback_on_mock_put( + test_adstandard_det.hdf.file_path, on_set_file_path_callback + ) + + # Set some sensible defaults to mimic a real detector setup + set_mock_value(test_adstandard_det.drv.acquire_time, (number - 0.2)) + set_mock_value(test_adstandard_det.drv.acquire_period, float(number)) + set_mock_value(test_adstandard_det.hdf.capture, True) + # Set number of frames per chunk and frame dimensions to something reasonable set_mock_value(test_adstandard_det.hdf.num_frames_chunks, 1) - set_mock_value(test_adstandard_det.drv.array_size_x, 10) - set_mock_value(test_adstandard_det.drv.array_size_y, 10) + set_mock_value(test_adstandard_det.drv.array_size_x, (9 + number)) + set_mock_value(test_adstandard_det.drv.array_size_y, (9 + number)) return test_adstandard_det