Beispiel #1
0
def run_py(file_path):
    meta = get_metamodel()
    model = meta.model_from_file(join(dirname(__file__), 'models', file_path))

    test_suite = TestSuitePy(verbose=False)
    test_suite.interpret(model)
    test_suite.run_all()

    return test_suite
Beispiel #2
0
def run_js(file_path):
    meta = get_metamodel()
    model = meta.model_from_file(join(dirname(__file__), 'models', file_path))

    test_suite = TestSuiteJs('../interpreter/javascript/TestHelper.js',
                             verbose=False)
    test_suite.interpret(model)
    test_suite.run_all()

    return test_suite
Beispiel #3
0
def test_validation_big():
    meta = get_metamodel()
    model = meta.model_from_file(
        join(dirname(__file__), 'models', 'dsl/model_big.test'))
    assert 3 == len(get_children_of_type('Test', model))
Beispiel #4
0
def test_validation_not_ok():
    meta = get_metamodel()
    with raises(TextXSemanticError):
        meta.model_from_file(
            join(dirname(__file__), 'models', 'dsl/model_not_ok.test'))