1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
import os
import os.path as osp
from testpath import assert_isfile
from extra_data.cli.make_virtual_cxi import main
def test_make_virtual_cxi(mock_spb_proc_run, tmpdir):
output = osp.join(str(tmpdir), 'test.cxi')
main([mock_spb_proc_run, '-o', output])
assert_isfile(output)
def test_make_virtual_cxi_runno(mock_spb_proc_run, tmpdir):
proc = osp.join(str(tmpdir), 'proc')
os.mkdir(proc)
os.symlink(mock_spb_proc_run, osp.join(proc, 'r0238'))
output = osp.join(str(tmpdir), 'test.cxi')
# Pass proposal directory and run number
main([str(tmpdir), '238', '-o', output])
assert_isfile(output)
def test_make_virtual_cxi_jungfrau(mock_jungfrau_run, tmpdir):
output = osp.join(str(tmpdir), 'test.cxi')
main([mock_jungfrau_run, '-o', output])
assert_isfile(output)
|