Skip to content

Commit

Permalink
Add test for #336, DataBlockFactory broken for single images (#337)
Browse files Browse the repository at this point in the history
  • Loading branch information
phyy-nx authored Apr 5, 2021
1 parent fef1d85 commit 62eedc0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions newsfragments/337.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add test for legacy datablock feature
16 changes: 16 additions & 0 deletions tests/test_datablock.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,19 @@ def test_with_external_lookup(centroid_test_data):
assert imageset.external_lookup.mask.data.tile(0).data().all_eq(True)
assert imageset.external_lookup.gain.data.tile(0).data().all_eq(1)
assert imageset.external_lookup.pedestal.data.tile(0).data().all_eq(0)


@pytest.mark.xfail(
raises=AssertionError, reason="/~https://github.com/cctbx/dxtbx/issues/336"
)
def test_single_image_datablock(dials_regression):
path = os.path.join(
dials_regression,
"image_examples",
"LCLS_cspad_nexus",
"idx-20130301060858401.cbf",
)
datablocks_cbf = DataBlockFactory.from_filenames([path])
datablock_cbf = datablocks_cbf[0]
imageset_cbf = datablock_cbf.extract_imagesets()[0]
assert imageset_cbf.get_detector(0) is not None

0 comments on commit 62eedc0

Please sign in to comment.