def test_determine_repeated_sequences_invalid_args(test_input, expectation): """Tests the behaviour of the determine_repeated function with unexpected inputs""" with expectation: rfm.determine_repeated(test_input)
def test_determine_repeated_incorrect_sequences(seq_input, expected): """Tests the behaviour of the translate_coding_sequences function with different sequence inputs""" assert rfm.determine_repeated(seq_input) == expected
def test_determine_repeated_no_repeat_input(): assert rfm.determine_repeated(coding_sequences_no_repeats) == []
#### TEST remove_repeated ####################################################### coding_sequences_repeated = {1:"ATGGTCGAACGGTCGTCAAAGTCAGAGTACCCCGGGTACCAACTTACGGAGGATATTGCTTGCAGCTGCTAA", 2:"ATGGTCGAACGGTCGTCAAAGTCAGAGTACCCCGGGTACCAACTTACGGAGGATATTGCTTGCAGCTGCTAA", 3:"ATGTTCAAAGGCGAAAGAACAAAGGCTTACTGTGCGCAGAGGAACGCCCATTTTGCGGCTGGCGTCTATTGA"} coding_sequences_no_repeats = {1:"ATGGTCGAACGGTCGTCAAAGTCAGAGTACCCCGGGTACCAACTTACGGAGGATATTGCTTGCAGCTGCTAA", 2:"ATGTTCAAAGGCGAAAGAACAAAGGCTTACTGTGCGCAGAGGAACGCCCATTTTGCGGCTGGCGTCTATTGA"} proteins_repeated = rfm.translate_coding_sequences(coding_sequences_repeated)[0] proteins_repeated2 = rfm.translate_coding_sequences(coding_sequences_repeated)[0] proteins_no_repeat = rfm.translate_coding_sequences(coding_sequences_no_repeats)[0] repeated_list = rfm.determine_repeated(coding_sequences_repeated) @pytest.mark.parametrize( "proteins, repeated_ids, expectation", [(5,5, pytest.raises(TypeError)) ]) def test_remove_repeated_sequences_invalid_args(proteins, repeated_ids, expectation): """Tests the behaviour of the remove_repeated function with unexpected inputs""" with expectation: rfm.remove_repeated(proteins, repeated_ids) #@pytest.mark.parametrize( # "proteins_incorrect, repeated_ids_incorrect, expected"
def test_determine_repeated_valid_input(): assert rfm.determine_repeated(coding_sequences_repeated) == [[1,2]]
def test_determine_repeated_empty_dict(): assert rfm.determine_repeated({}) == []
def test_determine_repeated_int_input(): with pytest.raises(AttributeError): rfm.determine_repeated(5)
def test_determine_repeated_empty_str(): with pytest.raises(AttributeError): rfm.determine_repeated("")
def test_determine_repeated_no_args(): with pytest.raises(TypeError): rfm.determine_repeated()