Skip to content

Commit 34df08b

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

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

@@ -87,7 +88,7 @@ async def test_can_collect(
8788
path_info = static_path_provider()
8889

8990
# If we are using the HDF writer, the uri will reference
90-
uri = str(path_info.directory_path) + "/"
91+
uri = str(path_info.directory_path) + os.sep
9192
if writer_cls == adcore.ADHDFWriter:
9293
uri = uri + f"{path_info.filename}.h5"
9394
test_det = ad_standard_det_factory(detector_cls, writer_cls=writer_cls)
@@ -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)