Skip to content

Commit 23a399f

Browse files
committed
Test passing Path to RunDirectory() & H5File()
1 parent be7fec7 commit 23a399f

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

extra_data/tests/test_reader_mockdata.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from datetime import datetime, timedelta, timezone
22
from itertools import islice
3+
from pathlib import Path
34
from warnings import catch_warnings
45

56
import h5py
@@ -317,7 +318,7 @@ def test_file_get_series_control(mock_fxe_control_data):
317318

318319
def test_file_get_series_instrument(mock_spb_proc_run):
319320
agipd_file = os.path.join(mock_spb_proc_run, 'CORR-R0238-AGIPD07-S00000.h5')
320-
with H5File(agipd_file) as f:
321+
with H5File(Path(agipd_file)) as f:
321322
s = f.get_series('SPB_DET_AGIPD1M-1/DET/7CH0:xtdf', 'header.linkId')
322323
assert isinstance(s, pd.Series)
323324
assert len(s) == 64
@@ -445,7 +446,7 @@ def test_run_get_array_error(mock_fxe_raw_run):
445446

446447

447448
def test_run_get_array_select_trains(mock_fxe_raw_run):
448-
run = RunDirectory(mock_fxe_raw_run)
449+
run = RunDirectory(Path(mock_fxe_raw_run))
449450
sel = run.select_trains(by_id[10100:10150])
450451
arr = sel.get_array(
451452
'SA1_XTD2_XGM/DOOCS/MAIN:output', 'data.intensityTD', extra_dims=['pulse']

0 commit comments

Comments
 (0)