Exemplo n.º 1
0
 def test_correctly_handles_partially_invalid_input(self):
     with self.assertRaises(ValueError):
         to_rna('ACGTXXXCTTAA')
 def test_does_not_transcribe_if_dna_has_trailing_whitespace(self):
     with self.assertRaisesWithMessage(ValueError):
         to_rna("""GCTA            
                """)
Exemplo n.º 3
0
 def test_correctly_handles_single_invalid_input(self):
     with self.assertRaises(ValueError):
         to_rna('U')
 def test_correctly_handles_completely_invalid_input(self):
     with self.assertRaisesWithMessage(ValueError):
         to_rna('XXX')
 def test_does_not_transcribe_if_dna_contains_invalids(self):
     with self.assertRaisesWithMessage(ValueError):
         to_rna('XCTGPABIXXYQ')
 def test_rna_complement(self):
     assert to_rna("ACGTGGTCTTAA") == "UGCACCAGAAUU"
Exemplo n.º 7
0
 def test_transcribes_guanine_to_cytosine(self):
     self.assertEqual(to_rna('G'), 'C')
Exemplo n.º 8
0
 def test_incorrect_nucleotide_single(self):
     with self.assertRaises(ValueError):
         to_rna('F')
Exemplo n.º 9
0
 def test_incorrect_nucleotide_multi(self):
     with self.assertRaises(ValueError):
         to_rna('ACGF')
 def test_transcribes_cytidine_unchanged(self):
     self.assertEqual('C', to_rna('G'))
 def test_transcribes_guanosine_unchanged(self):
     self.assertEqual('G', to_rna('C'))
 def test_transcribes_adenosine_unchanged(self):
     self.assertEqual('A', to_rna('T'))
Exemplo n.º 13
0
 def test_empty_rna_sequence(self):
     self.assertEqual(to_rna(""), "")
Exemplo n.º 14
0
 def test_correctly_handles_partially_invalid_input(self):
     with self.assertRaisesWithMessage(ValueError):
         to_rna('ACGTXXXCTTAA')
Exemplo n.º 15
0
 def test_correctly_handles_completely_invalid_input(self):
     self.assertMultiLineEqual(to_rna('XXX'), '')
Exemplo n.º 16
0
 def test_transcribes_all_occurrences(self):
     self.assertEqual(to_rna('ACGTGQTCTTAA'), Exception)
 def test_rna_complement_of_thymine_is_adenine(self):
     assert to_rna("T") == "A"
Exemplo n.º 18
0
 def test_transcribes_all_occurrences(self):
     self.assertEqual(to_rna('ACGTGGTCTTAA'), 'UGCACCAGAAUU')
 def test_rna_complement_of_cytosine_is_guanine(self):
     assert to_rna("C") == "G"
 def test_rna_complement_of_guanine_is_cytosine(self):
     self.assertEqual(to_rna("G"), "C")
Exemplo n.º 21
0
 def test_transcribes_adenine_to_uracil(self):
     self.assertEqual(to_rna('A'), 'U')
 def test_rna_complement_of_thymine_is_adenine(self):
     self.assertEqual(to_rna("T"), "A")
Exemplo n.º 23
0
 def test_does_not_transcribe_blank_string(self):
     with self.assertRaisesWithMessage(ValueError):
         to_rna('            ')
 def test_rna_complement_of_adenine_is_uracil(self):
     self.assertEqual(to_rna("A"), "U")
Exemplo n.º 25
0
 def test_does_not_transcribe_if_dna_is_broken_even_with_only_valids(self):
     with self.assertRaisesWithMessage(ValueError):
         to_rna('GTCA    GTCA')
 def test_rna_complement(self):
     self.assertEqual(to_rna("ACGTGGTCTTAA"), "UGCACCAGAAUU")
Exemplo n.º 27
0
<<<<<<< HEAD
    def test_transcribes_guanine_to_cytosine(self):
        self.assertEqual(to_rna('G'), 'C')

=======
>>>>>>> 371894dab186cec701ce325dcc4d002c02d93cbd
    def test_transcribes_thymine_to_adenine(self):
        self.assertEqual(to_rna('T'), 'A')

    def test_transcribes_adenine_to_uracil(self):
        self.assertEqual(to_rna('A'), 'U')

    def test_transcribes_all_occurences(self):
<<<<<<< HEAD
        self.assertEqual(to_rna('ACGTGGTCTTAA'), 'UGCACCAGAAUU')

    def test_correctly_handles_single_invalid_input(self):
        with self.assertRaises(ValueError):
            to_rna('U')

    def test_correctly_handles_completely_invalid_input(self):
        with self.assertRaises(ValueError):
            to_rna('XXX')

    def test_correctly_handles_partially_invalid_input(self):
        with self.assertRaises(ValueError):
            to_rna('ACGTXXXCTTAA')
=======
        self.assertMultiLineEqual(to_rna('ACGTGGTCTTAA'), 'UGCACCAGAAUU')
def test_is_valid_RNA(value_to_check, expected_result):
    assert to_rna(value_to_check) == expected_result
Exemplo n.º 29
0
 def test_correctly_handles_completely_invalid_input(self):
     with self.assertRaises(ValueError):
         to_rna('XXX')
Exemplo n.º 30
0
 def test_transcribes_thymine_to_adenine(self):
     self.assertEqual('A', to_rna('T'))
Exemplo n.º 31
0
 def test_correctly_handles_single_invalid_input(self):
     self.assertEqual(to_rna('U'), '')
Exemplo n.º 32
0
 def test_transcribes_adenine_to_uracil(self):
     self.assertEqual('U', to_rna('A'))
Exemplo n.º 33
0
 def test_correctly_handles_partially_invalid_input(self):
     self.assertMultiLineEqual(to_rna('ACGTXXXCTTAA'), '')
 def test_transcribes_all_occurences(self):
     self.assertMultiLineEqual('UGCACCAGAAUU', to_rna('ACGTGGTCTTAA'))
 def test_rna_complement_of_adenine_is_uracil(self):
     assert to_rna("A") == "U"
Exemplo n.º 36
0
 def test_correctly_handles_single_invalid_input(self):
     self.assertEqual('', to_rna('U'))
 def test_empty_rna_sequence(self):
     assert to_rna("") == ""
Exemplo n.º 38
0
 def test_correctly_handles_completely_invalid_input(self):
     self.assertMultiLineEqual('', to_rna('XXX'))
Exemplo n.º 39
0
 def test_empty_rna_sequence(self):
     self.assertEqual(to_rna(""), "")
Exemplo n.º 40
0
 def test_correctly_handles_partially_invalid_input(self):
     self.assertMultiLineEqual('', to_rna('ACGTXXXCTTAA'))
Exemplo n.º 41
0
 def test_transcribes_thymine_to_adenine(self):
     self.assertEqual(to_rna('T'), 'A')
Exemplo n.º 42
0
 def test_transcribes_guanine_to_cytosine(self):
     self.assertEqual('C', to_rna('G'))
Exemplo n.º 43
0
 def test_transcribes_all_occurrences(self):
     self.assertEqual(to_rna('ACGTGGTCTTAA'), 'UGCACCAGAAUU')
Exemplo n.º 44
0
 def test_correctly_handles_single_invalid_input(self):
     with self.assertRaisesWithMessage(ValueError):
         to_rna('U')