File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -195,14 +195,9 @@ def resolved_path(
195
195
if link == "" :
196
196
return base_url
197
197
else :
198
- return base_url ._replace (
199
- path = str (
200
- (
201
- pathlib .Path (base_url .path ).parent / pathlib .Path (link )
202
- ).resolve ()
203
- )
198
+ return urllib .parse .urlparse (
199
+ urllib .parse .urljoin (base_url .geturl (), link_url .geturl ())
204
200
)
205
-
206
201
else :
207
202
# Remote relative path
208
203
return urllib .parse .urlparse (
Original file line number Diff line number Diff line change
1
+ from urllib .parse import urlparse
2
+
3
+ from cwl_utils .utils import resolved_path
4
+
5
+
6
+ def test_resoled_path () -> None :
7
+ base_url = urlparse (
8
+ "schemas/bclconvert-run-configuration/2.0.0--4.0.3/bclconvert-run-configuration__2.0.0--4.0.3.yaml"
9
+ )
10
+ link = "../../../schemas/samplesheet/2.0.0--4.0.3/samplesheet__2.0.0--4.0.3.yaml#samplesheet"
11
+ rpath = resolved_path (base_url , link )
12
+ assert rpath == urlparse (
13
+ "schemas/samplesheet/2.0.0--4.0.3/samplesheet__2.0.0--4.0.3.yaml#samplesheet"
14
+ )
You can’t perform that action at this time.
0 commit comments