Beispiel #1
0
def test_check_type_default(capsys):
    assert not Db.check_type(None)
    assert Db.check_type("foo") == "protein"
    out, err = capsys.readouterr()
    assert err == "Warning: 'foo' is not a valid choice for '_type'. Setting to default 'protein'.\n"
Beispiel #2
0
def test_check_type_nuc():
    for _input in [
            "n", "ncl", "nuc", "dna", "nt", "gene", "transcript", "nucleotide"
    ]:
        assert Db.check_type(_input) == "nucleotide"
Beispiel #3
0
def test_check_type_gi():
    for _input in ["g", "gi", "gn", "gin", "gi_num", "ginum", "gi_number"]:
        assert Db.check_type(_input) == "gi_num"
Beispiel #4
0
def test_check_type_protein():
    for _input in [
            "p", "pr", "prt", "prtn", "prn", "prot", "protn", "protien",
            "protein"
    ]:
        assert Db.check_type(_input) == "protein"