Skip to content

Commit 2b10fa1

Browse files
author
Kaushik Ghose
committed
Add direct test for linked remote files w. commit hash
This test is somewhat brittle because it assumes the existence of this repository on github. If github disappears, or this repository is no longer hosted there this test will have to be updated.
1 parent 84868af commit 2b10fa1

File tree

4 files changed

+46
-115
lines changed

4 files changed

+46
-115
lines changed

benten/cwl/typeinference.py

-3
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
from .anytype import CWLAnyType
88
from .namespacedtype import CWLNameSpacedType
99

10-
import logging
11-
logger = logging.getLogger(__name__)
12-
1310

1411
def infer_type(node, allowed_types,
1512
key: str = None, map_sp: MapSubjectPredicate = None) -> CWLBaseType:

tests/cwl/misc/remote-steps.cwl

-112
This file was deleted.

tests/cwl/misc/wf-remote-steps.cwl

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# This test is somewhat brittle because it assumes the
2+
# existence of this repository on github. If github
3+
# disappears, or this repository is no longer hosted there
4+
# the CWL for this test will have to be updated.
5+
6+
cwlVersion: v1.0
7+
class: Workflow
8+
9+
inputs:
10+
in1: string
11+
12+
steps:
13+
step1:
14+
run: https://raw.githubusercontent.com/rabix/benten/4223a4/tests/cwl/misc/clt1.cwl
15+
in:
16+
in1: in1
17+
out: [out1]
18+
19+
step2:
20+
run: https://raw.githubusercontent.com/rabix/benten/5223a4/tests/cwl/misc/clt1.cwl
21+
in:
22+
in1: in1
23+
out: [out1]
24+
25+
26+
outputs:
27+
out1:
28+
type: string
29+
outputSource: [step1/out1, step2/out1]

tests/test_code_intelligence.py

+17
Original file line numberDiff line numberDiff line change
@@ -97,3 +97,20 @@ def test_port_completer():
9797

9898
cmpl = doc.completion(Position(24, 9)) # Is a list
9999
assert "in1" in [c.label for c in cmpl]
100+
101+
102+
# This test is somewhat brittle because it assumes the
103+
# existence of this repository on github. If github
104+
# disappears, or this repository is no longer hosted there
105+
# the CWL for this test will have to be updated.
106+
def test_remote_files():
107+
this_path = current_path / "cwl" / "misc" / "wf-remote-steps.cwl"
108+
doc = load(doc_path=this_path, type_dicts=type_dicts)
109+
110+
# Refers to an earlier commit
111+
hov = doc.hover(Position(13, 32))
112+
assert "class:" in hov.contents.value
113+
114+
# Non existent commit
115+
hov = doc.hover(Position(19, 32))
116+
assert hov.contents.value == "```\n\n```"

0 commit comments

Comments
 (0)