Пример #1
0
 def test_load_cwlschema(self):
     doc = cg_metaschema.load_document(
         file_uri(get_data("tests/test_schema/CommonWorkflowLanguage.yml")),
         "", cg_metaschema.LoadingOptions())
     with open(get_data("tests/cwl-pre.yml")) as f:
         pre = json.load(f)
     saved = [d.save() for d in doc]
     self.assertEqual(saved, JsonDiffMatcher(pre))
Пример #2
0
 def test_load_metaschema(self):
     doc = cg_metaschema.load_document(
         file_uri(get_data("metaschema/metaschema.yml")), "",
         cg_metaschema.LoadingOptions())
     with open(get_data("tests/metaschema-pre.yml")) as f:
         pre = json.load(f)
     saved = [d.save(relative_uris=False) for d in doc]
     self.assertEqual(saved, JsonDiffMatcher(pre))
Пример #3
0
def test_load_metaschema(metaschema_pre: Any) -> None:
    path = get_data("metaschema/metaschema.yml")
    assert path
    doc = cg_metaschema.load_document(
        file_uri(path),
        "",
        None,
    )
    saved = [d.save(relative_uris=False) for d in doc]
    assert saved == JsonDiffMatcher(metaschema_pre)
Пример #4
0
def test_load_cwlschema():
    doc = cg_metaschema.load_document(
        file_uri(get_data("tests/test_schema/CommonWorkflowLanguage.yml")),
        "",
        cg_metaschema.LoadingOptions(),
    )
    with open(get_data("tests/cwl-pre.yml")) as f:
        pre = json.load(f)
    saved = [d.save(relative_uris=False) for d in doc]
    assert saved == JsonDiffMatcher(pre)
Пример #5
0
 def test_load_pt(self):
     doc = cg_metaschema.load_document(file_uri(get_data("tests/pt.yml")),
                                       "", cg_metaschema.LoadingOptions())
     self.assertEqual([
         'https://w3id.org/cwl/salad#null',
         'http://www.w3.org/2001/XMLSchema#boolean',
         'http://www.w3.org/2001/XMLSchema#int',
         'http://www.w3.org/2001/XMLSchema#long',
         'http://www.w3.org/2001/XMLSchema#float',
         'http://www.w3.org/2001/XMLSchema#double',
         'http://www.w3.org/2001/XMLSchema#string'
     ], doc.symbols)
Пример #6
0
def test_load_pt():
    doc = cg_metaschema.load_document(file_uri(get_data("tests/pt.yml")), "",
                                      cg_metaschema.LoadingOptions())
    assert [
        "https://w3id.org/cwl/salad#null",
        "http://www.w3.org/2001/XMLSchema#boolean",
        "http://www.w3.org/2001/XMLSchema#int",
        "http://www.w3.org/2001/XMLSchema#long",
        "http://www.w3.org/2001/XMLSchema#float",
        "http://www.w3.org/2001/XMLSchema#double",
        "http://www.w3.org/2001/XMLSchema#string",
    ] == doc.symbols
Пример #7
0
def test_load_metaschema() -> None:
    path = get_data("metaschema/metaschema.yml")
    assert path
    doc = cg_metaschema.load_document(
        file_uri(path),
        "",
        cg_metaschema.LoadingOptions(),
    )
    path2 = get_data("tests/metaschema-pre.yml")
    assert path2
    with open(path2) as f:
        pre = json.load(f)
    saved = [d.save(relative_uris=False) for d in doc]
    assert saved == JsonDiffMatcher(pre)
Пример #8
0
 def test_import2(self):
     rs = cg_metaschema.load_document(
         file_uri(get_data("tests/docimp/d1.yml")), "",
         cg_metaschema.LoadingOptions())
     self.assertEqual([{
         'doc': [
             u'*Hello*', 'hello 2', u'*dee dee dee five*', 'hello 3',
             'hello 4', u'*dee dee dee five*', 'hello 5'
         ],
         'type':
         'documentation',
         'name':
         file_uri(get_data("tests/docimp/d1.yml")) +
         "#Semantic_Annotations_for_Linked_Avro_Data"
     }], [r.save() for r in rs])
Пример #9
0
def test_import2():
    rs = cg_metaschema.load_document(file_uri(get_data("tests/docimp/d1.yml")),
                                     "", cg_metaschema.LoadingOptions())
    assert [{
        "doc": [
            "*Hello*",
            "hello 2",
            "*dee dee dee five*",
            "hello 3",
            "hello 4",
            "*dee dee dee five*",
            "hello 5",
        ],
        "type":
        "documentation",
        "name":
        file_uri(get_data("tests/docimp/d1.yml")) +
        "#Semantic_Annotations_for_Linked_Avro_Data",
    }] == [r.save() for r in rs]