Ejemplo n.º 1
0
def test_translate_coding_sequences_invalid_args(test_input, expectation):
        """Tests the behaviour of the translate_coding_sequences function with unexpected inputs"""
        with expectation:
                rfm.translate_coding_sequences(test_input)
Ejemplo n.º 2
0
def test_translate_coding_sequences_incorrect_sequences(seq_input, expected):
        """Tests the behaviour of the translate_coding_sequences function with different sequence inputs"""
        assert rfm.translate_coding_sequences(seq_input) == expected
Ejemplo n.º 3
0
def test_translate_coding_sequences_untranslatable_input():
   assert rfm.translate_coding_sequences({1:"AAAAAAAAAAAA"}) == [{}, {}, {}, {1: 'AAAAAAAAAAAA'}]
Ejemplo n.º 4
0
        """Tests the behaviour of the translate_coding_sequences function with different sequence inputs"""
        assert rfm.determine_repeated(seq_input) == expected


############################################################################################

#### 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):
Ejemplo n.º 5
0
def test_translate_coding_sequences_ambiguous_input():
   assert rfm.translate_coding_sequences({1:"ATGNGTCAATAA"}) == [{}, {}, {1: 'ATGNGTCAATAA'}, {}]
Ejemplo n.º 6
0
def test_translate_coding_sequences_valid_input():
   assert rfm.translate_coding_sequences({1:"ATGGGTCAATAA"}) == [{1: 'MGQ'}, {1: 'sense'}, {}, {}]
Ejemplo n.º 7
0
def test_translate_coding_sequences_empty_str():
   with pytest.raises(AttributeError):
       rfm.translate_coding_sequences("")
Ejemplo n.º 8
0
def test_translate_coding_sequences_int_input():
   with pytest.raises(AttributeError):
       rfm.translate_coding_sequences(5)
Ejemplo n.º 9
0
def test_translate_coding_sequences_no_args():
   with pytest.raises(TypeError):
       rfm.translate_coding_sequences()