Skip to content

Commit

Permalink
Add direct test for linked remote files w. commit hash
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Kaushik Ghose committed Dec 9, 2019
1 parent 84868af commit 2b10fa1
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 115 deletions.
3 changes: 0 additions & 3 deletions benten/cwl/typeinference.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
from .anytype import CWLAnyType
from .namespacedtype import CWLNameSpacedType

import logging
logger = logging.getLogger(__name__)


def infer_type(node, allowed_types,
key: str = None, map_sp: MapSubjectPredicate = None) -> CWLBaseType:
Expand Down
112 changes: 0 additions & 112 deletions tests/cwl/misc/remote-steps.cwl

This file was deleted.

29 changes: 29 additions & 0 deletions tests/cwl/misc/wf-remote-steps.cwl
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# 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
# the CWL for this test will have to be updated.

cwlVersion: v1.0
class: Workflow

inputs:
in1: string

steps:
step1:
run: https://raw.githubusercontent.com/rabix/benten/4223a4/tests/cwl/misc/clt1.cwl
in:
in1: in1
out: [out1]

step2:
run: https://raw.githubusercontent.com/rabix/benten/5223a4/tests/cwl/misc/clt1.cwl
in:
in1: in1
out: [out1]


outputs:
out1:
type: string
outputSource: [step1/out1, step2/out1]
17 changes: 17 additions & 0 deletions tests/test_code_intelligence.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,20 @@ def test_port_completer():

cmpl = doc.completion(Position(24, 9)) # Is a list
assert "in1" in [c.label for c in cmpl]


# 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
# the CWL for this test will have to be updated.
def test_remote_files():
this_path = current_path / "cwl" / "misc" / "wf-remote-steps.cwl"
doc = load(doc_path=this_path, type_dicts=type_dicts)

# Refers to an earlier commit
hov = doc.hover(Position(13, 32))
assert "class:" in hov.contents.value

# Non existent commit
hov = doc.hover(Position(19, 32))
assert hov.contents.value == "```\n\n```"

0 comments on commit 2b10fa1

Please sign in to comment.