id3c.tests.test_flyscan_repair#

Tests for id3c.utils.flyscan_repair (the repair CLI).

Synthetic master + area-detector HDF5 files; the catalog run is faked and injected by monkeypatching _get_run. No IOC, no live catalog.

Attributes#

Functions#

test_read_run_uid(tmp_path)

The uid is read from /entry/entry_identifier.

test_resolve_external_file_from_link(tmp_path)

The external link target is resolved relative to the master dir.

test_resolve_external_file_from_metadata(tmp_path)

With no link, the AD path is composed from start metadata.

test_repair_writes_flyscan_data(tmp_path, _patch_run)

A full repair writes /entry/flyscan_data with the paired frames.

test_repair_is_idempotent(tmp_path, _patch_run)

Running twice yields the same group (no crash on re-write).

test_dry_run_does_not_write(tmp_path, _patch_run)

--dry-run reports but leaves the master unchanged.

test_missing_uid_raises(tmp_path)

A master with no entry_identifier is an error.

test_unresolvable_ad_file_raises(tmp_path)

A non-existent area-detector file is an error.

test_cli_main_success(tmp_path, _patch_run, capsys)

The CLI returns 0 and prints a summary on success.

test_cli_main_failure_returns_1(tmp_path, capsys)

The CLI returns 1 and reports the error on failure.

Module Contents#

id3c.tests.test_flyscan_repair.UID = 'abc123de-0000-1111-2222-333344445555'[source]#
id3c.tests.test_flyscan_repair.UID_DSET = '/entry/instrument/detector/NDAttributes/NDArrayUniqueId'[source]#
id3c.tests.test_flyscan_repair.TS_DSET = '/entry/instrument/detector/NDAttributes/NDArrayTimeStamp'[source]#
id3c.tests.test_flyscan_repair.test_read_run_uid(tmp_path)[source]#

The uid is read from /entry/entry_identifier.

The external link target is resolved relative to the master dir.

id3c.tests.test_flyscan_repair.test_resolve_external_file_from_metadata(tmp_path)[source]#

With no link, the AD path is composed from start metadata.

id3c.tests.test_flyscan_repair.test_repair_writes_flyscan_data(tmp_path, _patch_run)[source]#

A full repair writes /entry/flyscan_data with the paired frames.

id3c.tests.test_flyscan_repair.test_repair_is_idempotent(tmp_path, _patch_run)[source]#

Running twice yields the same group (no crash on re-write).

id3c.tests.test_flyscan_repair.test_dry_run_does_not_write(tmp_path, _patch_run)[source]#

–dry-run reports but leaves the master unchanged.

id3c.tests.test_flyscan_repair.test_missing_uid_raises(tmp_path)[source]#

A master with no entry_identifier is an error.

id3c.tests.test_flyscan_repair.test_unresolvable_ad_file_raises(tmp_path)[source]#

A non-existent area-detector file is an error.

id3c.tests.test_flyscan_repair.test_cli_main_success(tmp_path, _patch_run, capsys)[source]#

The CLI returns 0 and prints a summary on success.

id3c.tests.test_flyscan_repair.test_cli_main_failure_returns_1(tmp_path, capsys)[source]#

The CLI returns 1 and reports the error on failure.