def test_infos(input_description, codes): assert codes == [ info["code"] for info in name_check(input_description)["infos"] ]
def test_ensembl(input_description, normalized): d = name_check(input_description) assert d["normalized_description"] == normalized
def test_protein_equivalent(input_description, coding_protein_descriptions): normalized_output = name_check(input_description) normalizer_descriptions = set( normalized_output["equivalent_descriptions"]["c"]) assert coding_protein_descriptions.issubset(normalizer_descriptions)
def test_errors(input_description, codes): assert codes == [ error["code"] for error in name_check(input_description)["errors"] ]
def test_protein(input_description, protein_description): normalized_output = name_check(input_description) normalizer_protein = normalized_output["protein"]["description"] assert normalizer_protein == protein_description
def test_coding(input_description, coding): d = name_check(input_description) coding = [c[0] for c in coding] if d["equivalent_descriptions"].get("c"): name_check_coding = [c[0] for c in d["equivalent_descriptions"]["c"]] assert set(coding).issubset(set(name_check_coding))
def test_genomic(input_description, genomic): d = name_check(input_description) if d["equivalent_descriptions"].get("g"): assert d["equivalent_descriptions"]["g"][0] == genomic
def test_no_errors(input_description): assert name_check(input_description).get("errors") is None
def test_error(input_description, code): assert code_in(code, name_check(input_description)["errors"])