def test_number_positives_single_aa(): """Perform unit tests on number_positives() for single aa""" assert sf.number_positives('E') == 0 assert sf.number_positives('D') == 0 assert sf.number_positives('R') == 1 assert sf.number_positives('K') == 1 assert sf.number_positives('H') == 1
def test_number_positives_for_invalid_amino_acid_anywhere(): with pytest.raises(RuntimeError) as excinfo: seq_features.number_positives('AZK') excinfo.match("Z is not a valid amino acid")
def test_number_positives_for_lowercase(): """Perform unit tests on number_positives for lowercase""" assert seq_features.number_positives('rcklwttre') == 3
def test_low_pH(): assert seq_features.number_positives('ACKLHGR', pH=7.7) == 3 assert seq_features.number_positives('ACKLHGA', pH=9) == 1 assert seq_features.number_positives('ACKLHGR', pH=11) == 0
def test_number_positives_for_short_sequences(): """Perform unit tests on number_positives for short sequence""" assert seq_features.number_positives('RCKLWTTRE') == 3 assert seq_features.number_positives('DDDDEEEE') == 0
def test_number_positives_for_empty(): """Perform unit tests on number_positives for empty entry""" assert seq_features.number_positives('') == 0
def test_number_positives_single_R_K_or_H(): """Perform unit tests on number_positives for single AA""" assert seq_features.number_positives('R') == 1 assert seq_features.number_positives('K') == 1 assert seq_features.number_positives('H') == 1
def test_number_positives_invalid_amino_acid(): """Perform unit tests on number_positives() for invalid aa""" with pytest.raises(RuntimeError) as excinfo: sf.number_positives('Z') excinfo.match('Z is not a valid aa you fuckface')
def test_number_positives_lowercases(): """Perform unit tests on number_positives() for lower case aa""" assert sf.number_positives('adseds') == 0 assert sf.number_positives('akrhdkseds') == 4
def test_number_positives_short_seq(): """Perform unit tests on number_positives() for short sequences""" assert sf.number_positives('EEEEEAAAAA') == 0 assert sf.number_positives('KRAKRHAAAAA') == 5