goldpan.testing

The conformance test of an adapter, for the people who write one (see the guide “Writing an adapter” in the documentation).

Use it like this:

from goldpan.testing import check_adapter
passed = check_adapter(my_adapter_module, "sample/file", **read_kwargs)

It reads the sample with the adapter and checks the contract of goldpan.data.Events; that iter_chunks (if the adapter has it) gives, joined, the same events as read; and, if the adapter can write, that a written and read-back copy loses nothing (read back with the same read_kwargs, so an adapter that needs the detector name or the readout from the user can pass too). It raises AssertionError saying which check failed, and returns the list of the checks that passed.

Functions

check_adapter(module, sample_path, **read_kwargs)

Check module (an adapter) against the contract on sample_path; returns the checks passed, raises AssertionError.

goldpan.testing.check_adapter(module, sample_path, **read_kwargs)[source]

Check module (an adapter) against the contract on sample_path; returns the checks passed, raises AssertionError.

Return type:

list