Exemple #1
0
def test_go_rule28():

    config = assocparser.AssocParserConfig(ontology=ontology)

    a = ["blah"] * 15
    a[3] = ""
    a[4] = "GO:0005975"
    a[8] = "P"
    assoc = gafparser.to_association(a).associations[0]

    test_result = qc.GoRule28().test(assoc, config)

    assert test_result.result_type == qc.ResultType.PASS
    assert test_result.result == assoc

    a = ["blah"] * 15
    a[3] = ""
    a[4] = "GO:0005975"
    a[8] = "C"
    assoc = gafparser.to_association(a).associations[0]

    test_result = qc.GoRule28().test(assoc, config)

    assert test_result.result_type == qc.ResultType.WARNING
    fixed_assoc = copy.deepcopy(assoc)
    fixed_assoc.aspect = "P"
    assert test_result.result == fixed_assoc
    assert test_result.message == "Found violation of: `Aspect can only be one of C, P, F` but was repaired"
Exemple #2
0
def test_go_rule28():

    config = all_rules_config(ontology=ontology)

    assoc = make_annotation(goid="GO:0005975", evidence="IDA",
                            aspect="P").associations[0]
    test_result = qc.GoRule28().test(assoc, config)

    assert test_result.result_type == qc.ResultType.PASS
    assert test_result.result == assoc

    assoc = make_annotation(goid="GO:0005975", evidence="IDA",
                            aspect="C").associations[0]
    test_result = qc.GoRule28().test(assoc, config)

    assert test_result.result_type == qc.ResultType.WARNING
    fixed_assoc = copy.deepcopy(assoc)
    fixed_assoc.aspect = "P"
    assert test_result.result == fixed_assoc
    assert test_result.message == "Found violation of: `Aspect can only be one of C, P, F` but was repaired"
Exemple #3
0
def test_go_rule28():

    config = assocparser.AssocParserConfig(ontology=ontology)

    a = ["blah"] * 16
    a[4] = "GO:0005975"
    a[8] = "P"

    test_result = qc.GoRule28().test(a, config)

    assert test_result.result_type == qc.ResultType.PASS
    assert test_result.result == a

    a = ["blah"] * 16
    a[4] = "GO:0005975"
    a[8] = "C"

    test_result = qc.GoRule28().test(a, config)

    assert test_result.result_type == qc.ResultType.WARNING
    fixed_a = a
    fixed_a[8] = "P"
    assert test_result.result == fixed_a
    assert test_result.message == "Found violation of: `Aspect can only be one of C, P, F` but was repaired"