def test_number_negatives_for_invalid_amino_acid_anywhere(): with pytest.raises(RuntimeError) as excinfo: seq_features.number_negatives('AZK') excinfo.match("Z is not a valid amino acid")
def test_number_negatives_for_lowercase(): """Perform unit tests on number_negative for lowercase""" assert seq_features.number_negatives('acklwttae') == 1
def test_number_negatives_single_E_or_D(): """Perform unit tests on number_negative for single AA""" assert seq_features.number_negatives('E') == 1 assert seq_features.number_negatives('D') == 1
def test_number_negatives_for_short_sequences(): """Perform unit tests on number_negative for short sequence""" assert seq_features.number_negatives('ACKLWTTAE') == 1 assert seq_features.number_negatives('DDDDEEEE') == 8
def test_low_pH(): assert seq_features.number_negatives('ACDDEK', pH=3) == 0 assert seq_features.number_negatives('ACDDEK', pH=5) == 3
def test_number_negatives_for_invalid_amino_acid(): with pytest.raises(RuntimeError) as excinfo: seq_features.number_negatives('B') excinfo.match( "B is not a valid amino acid." ) # This is what we want the interpreter to say in this case.
def test_number_negatives_for_empty(): """Perform unit tests on number_negative for empty entry""" assert seq_features.number_negatives('') == 0
def test_number_negatives_for_invalid_amino_acid(): with pytest.raises(RuntimeError) as excinfo: seq_features.number_negatives('GADEADBACTZ') excinfo.match("B is not a valid amino acid")
def test_number_negatives_single_aa(): """Perform unit tests on number_negatives() for single aa""" assert sf.number_negatives('E') == 1 assert sf.number_negatives('D') == 1
def test_number_negatives_invalid_amino_acid(): """Perform unit tests on number_negatives() for invalid aa""" with pytest.raises(RuntimeError) as excinfo: sf.number_negatives('Z') excinfo.match('Z is not a valid aa you fuckface')
def test_number_negatives_lowercases(): """Perform unit tests on number_negatives() for lower case aa""" assert sf.number_negatives('adseds') == 3
def test_number_negatives_short_seq(): """Perform unit tests on number_negatives() for short sequences""" assert sf.number_negatives('EEEEEAAAAA') == 5