Esempio n. 1
0
def test_mass_wf_load():
    type_dicts = load_type_dicts()
    for wf_dir in [
            "ebi/workflows", "mgi/subworkflows", "mgi/pipelines", "cwl-v1.2"
    ]:
        path = current_path / "cwl" / wf_dir
        for fname in path.glob("*.cwl"):
            _ = load(doc_path=fname, type_dicts=type_dicts)
Esempio n. 2
0
def test_ebi_wf_cmsearch_multimodel():
    path = current_path / "cwl" / "ebi" / "workflows" / "cmsearch-multimodel-wf.cwl"
    doc = load(doc_path=path, type_dicts=load_type_dicts())

    step_symbols = next((symb for symb in doc.symbols if symb.name == "steps"),
                        None)
    assert isinstance(step_symbols.children, list)

    cmsearch_symbol = next(
        (symb for symb in step_symbols.children if symb.name == "cmsearch"),
        None)
    assert cmsearch_symbol.range.start.line == 33
Esempio n. 3
0
def test_connections():
    path = current_path / "cwl" / "misc" / "wf-port-completer.cwl"
    doc = load(doc_path=path, type_dicts=load_type_dicts())

    assert len(doc.problems) == 0
Esempio n. 4
0
def test_troublesome_tool_load():
    type_dicts = load_type_dicts()
    path = current_path / "cwl" / "misc"
    for fname in path.glob("*.cwl"):
        _ = load(doc_path=fname, type_dicts=type_dicts)
Esempio n. 5
0
def test_mass_tool_load():
    type_dicts = load_type_dicts()
    for wf_dir in ["ebi/tools", "mgi/tools"]:
        path = current_path / "cwl" / wf_dir
        for fname in path.glob("*.cwl"):
            _ = load(doc_path=fname, type_dicts=type_dicts)
Esempio n. 6
0
#  Copyright (c) 2019 Seven Bridges. See LICENSE

import pathlib

from lib import load, load_type_dicts

from benten.langserver.lspobjects import Position, Location

current_path = pathlib.Path(__file__).parent
schema_path = pathlib.Path(current_path, "../benten/000.package.data/")

type_dicts = load_type_dicts()
path = current_path / "cwl" / "ebi" / "workflows" / "cmsearch-multimodel-wf.cwl"


def test_definition():
    doc = load(doc_path=path, type_dicts=type_dicts)
    linked_uri = pathlib.Path(current_path / "cwl" / "ebi" / "utils" /
                              "concatenate.cwl")
    doc_def_loc = doc.definition(loc=Position(50, 20))
    assert isinstance(doc_def_loc, Location)
    assert doc_def_loc.uri == linked_uri.as_uri()


def test_record_field_completion():
    doc = load(doc_path=path, type_dicts=type_dicts)
    cmpl = doc.completion(Position(7, 0))
    assert "doc" in [c.label for c in cmpl]


def test_type_completion():