Skip to content

Commit f763005

Browse files
author
James Souter
committed
fix adcore stream_resource uri test to work with windows and linux paths
1 parent 8caaa30 commit f763005

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/epics/adcore/test_detectors.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import itertools
2+
import os
23

34
import pytest
45

@@ -89,7 +90,7 @@ async def test_can_collect(
8990
# If we are using the HDF writer, the uri will reference
9091
uri = str(path_info.directory_path) + "/"
9192
if writer_cls == adcore.ADHDFWriter:
92-
uri = uri + f"{path_info.filename}.h5"
93+
uri = uri.rstrip("/") + os.sep + f"{path_info.filename}.h5"
9394
test_det = ad_standard_det_factory(detector_cls, writer_cls=writer_cls)
9495

9596
await test_det.stage()
@@ -100,7 +101,9 @@ async def test_can_collect(
100101
stream_resource = docs[0][1]
101102
sr_uid = stream_resource["uid"]
102103
assert stream_resource["data_key"] == test_det.name
103-
assert stream_resource["uri"] == "file://localhost" + str(uri)
104+
assert stream_resource["uri"] == "/".join(
105+
["file://localhost", str(uri).lstrip("/")]
106+
)
104107

105108
# Construct expected stream resource parameters based on writer
106109
expected_sres_params = {

0 commit comments

Comments
 (0)