diff --git a/newsfragments/650.misc b/newsfragments/650.misc new file mode 100644 index 000000000..94f0ed982 --- /dev/null +++ b/newsfragments/650.misc @@ -0,0 +1 @@ +Format classes are now tested against invalid binary data with dials-data, for when dials-regression is not present. diff --git a/tests/format/test_format.py b/tests/format/test_format.py new file mode 100644 index 000000000..3b951ba8d --- /dev/null +++ b/tests/format/test_format.py @@ -0,0 +1,12 @@ +from __future__ import annotations + +from dxtbx.format import Registry + + +def test_reading_refl_failure(dials_data): + test_data = dials_data("centroid_test_data", pathlib=True) + + # Without dials_regression, none of the dials-data tests check for this "invalid binary data" case + assert Registry.get_format_class_for_file(test_data / "indexed.refl") is None + # Check .expt while here + assert Registry.get_format_class_for_file(test_data / "indexed.expt") is None