예제 #1
0
def test_remap_job():
    job = TEMPLATE_JOB
    tool = from_url(join(dirname(__file__), 'bwa-mem.json#tool'))
    context = init_context(tool)
    app = context.from_dict(tool)
    input_file = from_url(join(dirname(__file__), 'inputs.json'))
    startdir = './'
예제 #2
0
def test_invalid_json_schema():
    ctx = init_context()

    no_type = {
        "properties": {
            "a": {
                "type": "integer"
            }
        }
    }
    assert_raises(RabixError, JsonSchema, ctx, no_type)

    not_object = {
        "type": "int",
        "properties": {
            "a": {
                "type": "integer"
            }
        }
    }
    assert_raises(RabixError, JsonSchema, ctx, not_object)

    no_properties = {
        "type": "object",
    }
    assert_raises(RabixError, JsonSchema, ctx, no_properties)
예제 #3
0
def test_workflow():
    path = abspath(join(__file__, '../../test_runtime/wf_tests.yaml'))

    context = init_context()
    doc = from_url(path)
    tests = doc['tests']
    for test_name, test in six.iteritems(tests):
        features = test.get('requiresFeatures', [])
        if 'map' not in features:
            fix_types(test['job']['app'])
            yield assert_execution, context.from_dict(test['job']), test['outputs']
예제 #4
0
def test_workflow():
    path = abspath(join(__file__, '../../test_runtime/wf_tests.yaml'))

    doc = from_url(path)
    tests = doc['tests']
    for test_name, test in six.iteritems(tests):
        context = init_context(test['job'])
        job = Job.from_dict(context, test['job'])

        for inp in job.app.inputs:
            construct_files(job.inputs.get(inp.id), inp.validator)
        yield assert_execution, job, test['outputs']
예제 #5
0
def test_simple_json_schema():
    schema = {
        "type": "object",
        "properties": {
            "a": {
                "type": "integer"
            }
        }
    }

    js = JsonSchema(init_context(), schema)
    a = next(iter(js))
    assert_equal(a.id, 'a')
    assert_equal(a.constructor.name, 'integer')
    assert_false(a.required)

    to_dict = js.to_dict()
    for k, v in six.iteritems(schema):
        assert_equal(to_dict[k], v)