def test_gorule37(): a = ["blah"] * 15 a[3] = "" a[6] = "IBA" a[5] = "PMID:21873635" a[8] = "P" a[14] = "GO_Central" assoc = gafparser.to_association(a).associations[0] test_result = qc.GoRule37().test(assoc, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.PASS assoc.evidence.type = "ECO:0000305" # Rule doesn't apply, not IBA test_result = qc.GoRule37().test(assoc, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.PASS assoc.evidence.type = "ECO:0000318" assoc.evidence.has_supporting_reference = ["GO_REF:123" ] # IBA, but wrong ref test_result = qc.GoRule37().test(assoc, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.ERROR assoc.evidence.has_supporting_reference = ["PMID:21873635"] assoc.provided_by = "Pascale" # IBA, but wrong assigned_by test_result = qc.GoRule37().test(assoc, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.ERROR
def test_gorule37(): assoc = make_annotation(evidence="IBA", references="PMID:21873635", assigned_by="GO_Central").associations[0] test_result = qc.GoRule37().test(assoc, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.PASS assoc.evidence.type = Curie.from_str("ECO:0000305") # Rule doesn't apply, not IBA test_result = qc.GoRule37().test(assoc, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.PASS assoc.evidence.type = Curie.from_str("ECO:0000318") assoc.evidence.has_supporting_reference = [Curie.from_str("GO_REF:123")] # IBA, but wrong ref test_result = qc.GoRule37().test(assoc, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.ERROR assoc.evidence.has_supporting_reference = [Curie.from_str("PMID:21873635")] assoc.provided_by = "Pascale" # IBA, but wrong assigned_by test_result = qc.GoRule37().test(assoc, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.ERROR
def test_gorule36(): a = ["blah"] * 16 a[6] = "IBA" a[5] = "PMID:21873635" a[14] = "GO_Central" test_result = qc.GoRule37().test(a, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.PASS a[6] = "BLA" # Rule doesn't apply test_result = qc.GoRule37().test(a, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.PASS a[6] = "IBA" a[5] = "GO_REF:123" # IBA, but wrong ref test_result = qc.GoRule37().test(a, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.ERROR a[5] = "PMID:21873635" a[14] = "Pascale" # IBA, but wrong assigned_by test_result = qc.GoRule37().test(a, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.ERROR