From 03bd3d8f183b15a571dddbe5893afb735032968c Mon Sep 17 00:00:00 2001 From: Nicholas Devenish Date: Wed, 26 Jul 2023 14:23:59 +0100 Subject: [PATCH 1/2] Check Registry against refl/expt files This was previously done implicitly, but only when dials_regression was present. This makes the test explicit, and works with dials-data (so that it will work on e.g. CI with restricted access to test cases). --- newsfragments/XXX.misc | 1 + tests/format/test_format.py | 12 ++++++++++++ 2 files changed, 13 insertions(+) create mode 100644 newsfragments/XXX.misc create mode 100644 tests/format/test_format.py diff --git a/newsfragments/XXX.misc b/newsfragments/XXX.misc new file mode 100644 index 000000000..94f0ed982 --- /dev/null +++ b/newsfragments/XXX.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 From e83149799b14048c0565fe3353e7c956bea291a3 Mon Sep 17 00:00:00 2001 From: DiamondLightSource-build-server Date: Wed, 26 Jul 2023 13:25:20 +0000 Subject: [PATCH 2/2] Rename newsfragments/XXX.misc to newsfragments/650.misc --- newsfragments/{XXX.misc => 650.misc} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename newsfragments/{XXX.misc => 650.misc} (100%) diff --git a/newsfragments/XXX.misc b/newsfragments/650.misc similarity index 100% rename from newsfragments/XXX.misc rename to newsfragments/650.misc