def test_go_rule11(): a = ["blah"] * 16 a[4] = "GO:0003674" a[6] = "ND" test_result = qc.GoRule11().test(a, assocparser.AssocParserConfig()) print("first test, we have {}".format(test_result)) assert test_result.result_type == qc.ResultType.PASS # Bad GO ID a = ["blah"] * 16 a[4] = "GO:1234567" a[6] = "ND" test_result = qc.GoRule11().test(a, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.ERROR # Not ND and not Root a = ["blah"] * 16 a[4] = "GO:1234567" a[6] = "FOO" test_result = qc.GoRule11().test(a, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.PASS # Root, but not ND a = ["blah"] * 16 a[4] = "GO:0003674" a[6] = "FOO" test_result = qc.GoRule11().test(a, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.ERROR
def test_go_rule11(): a = ["blah"] * 15 a[3] = "" a[4] = "GO:0003674" a[6] = "ND" a[8] = "F" a[13] = "20200303" assoc = gafparser.to_association(a).associations[0] test_result = qc.GoRule11().test(assoc, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.PASS # Bad GO ID a = ["blah"] * 15 a[3] = "" a[4] = "GO:1234567" a[6] = "ND" a[8] = "F" a[13] = "20200303" assoc = gafparser.to_association(a).associations[0] test_result = qc.GoRule11().test(assoc, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.ERROR # Not ND and not Root a[3] = "" a[4] = "GO:1234567" a[6] = "IEA" a[8] = "F" a[13] = "20200303" assoc = gafparser.to_association(a).associations[0] test_result = qc.GoRule11().test(assoc, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.PASS # Root, but not ND a = ["blah"] * 15 a[3] = "" a[4] = "GO:0003674" a[6] = "IEA" a[8] = "F" a[13] = "20200303" assoc = gafparser.to_association(a).associations[0] test_result = qc.GoRule11().test(assoc, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.ERROR
def test_go_rule11(): assoc = make_annotation(goid="GO:0003674", evidence="ND").associations[0] test_result = qc.GoRule11().test(assoc, all_rules_config()) assert test_result.result_type == qc.ResultType.PASS # Bad GO ID assoc = make_annotation(goid="GO:1234567", evidence="ND").associations[0] test_result = qc.GoRule11().test(assoc, all_rules_config()) assert test_result.result_type == qc.ResultType.ERROR # Not ND and not Root assoc = make_annotation(goid="GO:1234567", evidence="IEA").associations[0] test_result = qc.GoRule11().test(assoc, all_rules_config()) assert test_result.result_type == qc.ResultType.PASS # Root, but not ND assoc = make_annotation(goid="GO:0003674", evidence="IEA").associations[0] test_result = qc.GoRule11().test(assoc, all_rules_config()) assert test_result.result_type == qc.ResultType.ERROR
def test_go_rule11(): a = ["blah"] * 16 a[4] = "GO:0003674" a[6] = "ND" test_result = qc.GoRule11().test(a, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.PASS # Bad GO ID a = ["blah"] * 16 a[4] = "GO:1234567" a[6] = "ND" test_result = qc.GoRule11().test(a, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.ERROR # Not ND a = ["blah"] * 16 a[4] = "GO:1234567" a[6] = "FOO" a[7] = "GO_REF:0000001" test_result = qc.GoRule11().test(a, assocparser.AssocParserConfig()) assert test_result.result_type == qc.ResultType.PASS