Ejemplo n.º 1
0
def test_validate_with_invalid_large_list():
    result = validate({"maxItems": 2}, [1, 2, 3])
    f.assert_failure(result)
    nose.assert_equal(
        result.getValue(),
        "Value [1, 2, 3] for field '<obj>' must have length less than or equal to 2"
    )
Ejemplo n.º 2
0
def test_check_mounted_fastq_files_that_are_not_gzipped():
    file = f.create_temp_file("")
    input_ = [{"fastq": {"id": "t", "value": file}}]
    result = main.check_mounted_files(f.create_biobox_dict(input_))
    f.assert_failure(result)
    nose.assert_equal(result.getValue(),
                      "Provided file '{0}' is not gzipped.".format(file))
Ejemplo n.º 3
0
def test_validate_with_missing_properties():
    schema = {
        "properties": {
            "version": {},
            "arguments": {}
        },
        "required": ["version", "arguments"]
    }
    input_ = {"version": {}}
    result = validate(schema, input_)
    f.assert_failure(result)
    nose.assert_equal(result.getValue(), "'arguments' is a required property")
Ejemplo n.º 4
0
def test_check_mounted_files_with_not_existing_files():
    input_ = {
        "version":
        "0.9.0",
        "arguments": [{
            "fastq": [{
                "id": "t",
                "value": "/path/to/file",
                "type": "paired"
            }]
        }]
    }
    result = main.check_mounted_files(input_)
    f.assert_failure(result)
Ejemplo n.º 5
0
def test_loading_invalid_yaml():
    file_ = f.create_temp_file("'invalid yaml")
    result = main.parse_yaml(file_)
    f.assert_failure(result)
Ejemplo n.º 6
0
def test_check_mounted_files_with_single_entry_having_missing_file():
    input_ = [{"fastq": {"id": "t", "value": "/path/to/file"}}]
    result = main.check_mounted_files(f.create_biobox_dict(input_))
    f.assert_failure(result)
    nose.assert_equal(result.getValue(),
                      "Provided path '/path/to/file' does not exist.")
Ejemplo n.º 7
0
def test_validate_with_invalid_large_list():
    result = validate({"maxItems": 2}, [1, 2, 3])
    f.assert_failure(result)
    nose.assert_equal(result.getValue(), "[1, 2, 3] is too long")