Esempio n. 1
0
def validate_command_line_options(options):
    # Validate command-line options
    try:
        opt.validate_dict_option(options[LOG_LEVEL], log.LEVELS,
                                 "Invalid log level")
    except schema.SchemaError as exc:
        exit(exc.code)
Esempio n. 2
0
def validate_command_line_options(options):
    # Validate command-line options
    try:
        opt.validate_dict_option(
            options[LOG_LEVEL], log.LEVELS, "Invalid log level")
    except schema.SchemaError as exc:
        exit(exc.code)
Esempio n. 3
0
def test_validate_dict_option_exception_message_contains_correct_info():
    values_dict = {1: "one", 2: "two"}

    msg = "dummy"
    key = 3
    with pytest.raises(SchemaError) as exc_info:
        validate_dict_option(key, values_dict, msg)

    check_exception_message(exc_info, msg, key)
def validate_command_line_options(options):
    try:
        opt.validate_dict_option(
            options[LOG_LEVEL], log.LEVELS, "Invalid log level")
        opt.validate_file_option(
            options[QUANT_FILE],
            "Could not open Sailfish quantification results file.")
    except schema.SchemaError as exc:
        exit("Exiting. " + exc.code)
def validate_command_line_options(options):
    try:
        opt.validate_dict_option(
            options[LOG_LEVEL], log.LEVELS, "Invalid log level")
        opt.validate_list_option(
            options[QUANT_METHOD], QUANT_METHODS,
            "Invalid quantification method")
        opt.validate_file_option(
            options[QUANT_FILE],
            "Could not open Sailfish quantification results file.")
        options[READ_LENGTH] = opt.validate_int_option(
            options[READ_LENGTH], "Read length must be a positive integer",
            min_val=0)
        options[PAIRED_END] = opt.check_boolean_value(options[PAIRED_END])
    except schema.SchemaError as exc:
        exit("Exiting. " + exc.code)
def validate_command_line_options(options):
    try:
        opt.validate_dict_option(
            options[LOG_LEVEL], log.LEVELS, "Invalid log level")
        opt.validate_file_option(
            options[TAQMAN_EXPRESSION_FILE],
            "Could not open TaqMan expression file.")
        opt.validate_file_option(
            options[SYNONYM_FILE],
            "Could not open synonym file.")

        for quant_file in options[QUANTIFICATION_FILES]:
            opt.validate_file_option(
                quant_file,
                "Could not open quantification file " + quant_file)
    except schema.SchemaError as exc:
        exit(exc.code)
Esempio n. 7
0
def validate_command_line_options(options):
    try:
        opt.validate_dict_option(
            options[LOG_LEVEL], log.LEVELS, "Invalid log level")
        opt.validate_file_option(
            options[TAQMAN_EXPRESSION_FILE],
            "Could not open TaqMan expression file.")
        opt.validate_file_option(
            options[QUANTIFICATION_FILE],
            "Could not open quantification file.")
        opt.validate_file_option(
            options[SYNONYM_FILE],
            "Could not open synonym file.")

        options[REF_TYPE] = options[REF_TYPE].lower()
        opt.validate_list_option(
            options[REF_TYPE], maqc.REFERENCE_SETS,
            "Invalid reference type")
    except schema.SchemaError as exc:
        exit(exc.code)
Esempio n. 8
0
def validate_command_line_options(options):
    try:
        opt.validate_dict_option(options[LOG_LEVEL], log.LEVELS, "Invalid log level.")
        opt.validate_file_option(options[REGIONS_FILE], "Could not open region locations file.")
    except schema.SchemaError as exc:
        exit("Exiting. " + exc.code)
Esempio n. 9
0
def test_validate_dict_option_raises_exception_for_non_existent_key():
    values_dict = {1: "one", 2: "two"}
    with pytest.raises(SchemaError):
        validate_dict_option(3, values_dict, "dummy")
Esempio n. 10
0
def test_validate_dict_option_returns_correct_dict_value():
    values_dict = {1: "one", 2: "two"}
    assert validate_dict_option(2, values_dict, "dummy") == "two"