File: test_make_virtual_cxi.py

package info (click to toggle)
extra-data 1.20.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, trixie
  • size: 952 kB
  • sloc: python: 10,421; makefile: 4
file content (25 lines) | stat: -rw-r--r-- 814 bytes parent folder | download | duplicates (3)
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)