def test_gorule46(): config = assocparser.AssocParserConfig(ontology=ontology) a = ["blah"] * 15 a[0] = "PomBase" a[1] = "SPAC25B8.17" a[3] = "" a[4] = "GO:0051260" # Self-binding, yes a[7] = "PomBase:SPAC25B8.17" a[8] = "P" assoc = gafparser.to_association(a).associations[0] test_result = qc.GoRule46().test(assoc, config) assert test_result.result_type == qc.ResultType.PASS assoc.evidence.with_support_from = ["PomBase:BLAH123"] test_result = qc.GoRule46().test(assoc, config) assert test_result.result_type == qc.ResultType.WARNING assoc.evidence.with_support_from = [ "PomBase:SPAC25B8.17", "PomBase:BLAH123" ] test_result = qc.GoRule46().test(assoc, config) assert test_result.result_type == qc.ResultType.PASS assoc.object.id = "GO:0000123" # Not in a self-binding mode test_result = qc.GoRule46().test(assoc, config) assert test_result.result_type == qc.ResultType.PASS # Test no ontology should just pass assoc.object.id = "GO:0051260" test_result = qc.GoRule46().test(assoc, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.PASS
def test_gorule46(): config = all_rules_config(ontology=ontology) # Self-binding, yes assoc = make_annotation(db="PomBase", db_id="SPAC25B8.17", goid="GO:0051260", withfrom="PomBase:SPAC25B8.17").associations[0] test_result = qc.GoRule46().test(assoc, config) assert test_result.result_type == qc.ResultType.PASS assoc.evidence.with_support_from = association.ConjunctiveSet.str_to_conjunctions( "PomBase:BLAH123") test_result = qc.GoRule46().test(assoc, config) assert test_result.result_type == qc.ResultType.WARNING assoc.evidence.with_support_from = association.ConjunctiveSet.str_to_conjunctions( "PomBase:SPAC25B8.17|PomBase:BLAH123") test_result = qc.GoRule46().test(assoc, config) assert test_result.result_type == qc.ResultType.PASS assoc.object.id = Curie.from_str("GO:0000123") # Not in a self-binding mode test_result = qc.GoRule46().test(assoc, config) assert test_result.result_type == qc.ResultType.PASS # Test no ontology should just pass assoc.object.id = Curie.from_str("GO:0051260") test_result = qc.GoRule46().test(assoc, all_rules_config()) assert test_result.result_type == qc.ResultType.PASS
def test_gorule46(): config = assocparser.AssocParserConfig(ontology=ontology) a = ["blah"] * 16 a[1] = "SPAC25B8.17" a[4] = "GO:0051260" # Self-binding, yes a[7] = "SPAC25B8.17" test_result = qc.GoRule46().test(a, config) assert test_result.result_type == qc.ResultType.PASS a[7] = "BLAH123" test_result = qc.GoRule46().test(a, config) assert test_result.result_type == qc.ResultType.WARNING a[7] = "SPAC25B8.17|BLAH123" test_result = qc.GoRule46().test(a, config) assert test_result.result_type == qc.ResultType.PASS a[4] = "GO:0000123" # Not in a self-binding mode test_result = qc.GoRule46().test(a, config) assert test_result.result_type == qc.ResultType.PASS