Refactor integration tests
Integration tests are in ./test
and may need external data or services.
For example one that needs external data
def test_getListFineSlicedReferenceImagePath(self):
beamline = "id30a1"
strategy_result = edna_mxv1.create_n_images_data_collect(
exposureTime=1.0,
transmission=100,
number_of_images=1,
osc_range=0.1,
phi=123.0,
)
directory = (
"/data/id30a1/inhouse/opid30a1/20220408/RAW_DATA/Sample-8-1-01/MXPressA_01"
)
run_number = 1
exp_type_prefix = "ref-fineslice-"
prefix = "opid30a1"
suffix = "cbf"
tmpdir = tempfile.mkdtemp()
edna_mxv1.getListFineSlicedReferenceImagePath(
beamline=beamline,
mxv1StrategyResult=strategy_result,
directory=directory,
run_number=run_number,
expTypePrefix=exp_type_prefix,
prefix=prefix,
suffix=suffix,
dest_dir=tmpdir,
)
Refactor
-
rename ./src/bes/test
to./src/bes/tests
-
modify tests in ./test
to usepytest
and move to./src/bes/tests
-
use pytest.skip
when the external resource is not available -
copy external data to /data/scisoft/bes_testdata
Edited by Wout De Nolf