Skip to content

Commit

Permalink
Check Registry against refl/expt files (cctbx#650)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
ndevenish authored Jul 26, 2023
1 parent 180fac8 commit e9b88d2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions newsfragments/650.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Format classes are now tested against invalid binary data with dials-data, for when dials-regression is not present.
12 changes: 12 additions & 0 deletions tests/format/test_format.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit e9b88d2

Please sign in to comment.