Ejemplo n.º 1
0
def test_gorule42():
    assoc = make_annotation(qualifier="NOT", evidence="IKR").associations[0]

    test_result = qc.GoRule42().test(assoc, all_rules_config())
    assert test_result.result_type == qc.ResultType.PASS

    assoc.evidence.type = "ECO:0000305"  # Not IKR so this rule is fine
    test_result = qc.GoRule42().test(assoc, all_rules_config())
    assert test_result.result_type == qc.ResultType.PASS

    assoc.evidence.type = "ECO:0000320"
    assoc.negated = False  # Not negated, so wrong
    test_result = qc.GoRule42().test(assoc, all_rules_config())
    assert test_result.result_type == qc.ResultType.ERROR
Ejemplo n.º 2
0
def test_gorule42():
    a = ["blah"] * 16
    a[6] = "IKR"
    a[3] = "NOT"

    test_result = qc.GoRule42().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.PASS

    a[6] = "BLA"  # Not IKR so this rule is fine
    test_result = qc.GoRule42().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.PASS

    a[6] = "IKR"
    a[3] = ""  # No NOT qualifier, so wrong
    test_result = qc.GoRule42().test(a, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.ERROR
Ejemplo n.º 3
0
def test_gorule42():
    a = ["blah"] * 15
    a[3] = "NOT"
    a[6] = "IKR"
    a[8] = "P"
    assoc = gafparser.to_association(a).associations[0]

    test_result = qc.GoRule42().test(assoc, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.PASS

    assoc.evidence.type = "ECO:0000305"  # Not IKR so this rule is fine
    test_result = qc.GoRule42().test(assoc, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.PASS

    assoc.evidence.type = "ECO:0000320"
    assoc.negated = False  # Not negated, so wrong
    test_result = qc.GoRule42().test(assoc, assocparser.AssocParserConfig())
    assert test_result.result_type == qc.ResultType.ERROR