33from rna_transcription import to_rna
44
55
6- # Tests adapted from `problem-specifications//canonical-data.json` @ v1.0.1
6+ # Tests adapted from `problem-specifications//canonical-data.json` @ v1.2.0
77
8- class DNATests (unittest .TestCase ):
8+ class RNATranscriptionTests (unittest .TestCase ):
99
1010 def test_transcribes_cytosine_to_guanine (self ):
1111 self .assertEqual (to_rna ('C' ), 'G' )
@@ -19,31 +19,9 @@ def test_transcribes_thymine_to_adenine(self):
1919 def test_transcribes_adenine_to_uracil (self ):
2020 self .assertEqual (to_rna ('A' ), 'U' )
2121
22- def test_transcribes_all_occurences (self ):
22+ def test_transcribes_all_occurrences (self ):
2323 self .assertEqual (to_rna ('ACGTGGTCTTAA' ), 'UGCACCAGAAUU' )
2424
25- def test_correctly_handles_single_invalid_input (self ):
26- with self .assertRaisesWithMessage (ValueError ):
27- to_rna ('U' )
28-
29- def test_correctly_handles_completely_invalid_input (self ):
30- with self .assertRaisesWithMessage (ValueError ):
31- to_rna ('XXX' )
32-
33- def test_correctly_handles_partially_invalid_input (self ):
34- with self .assertRaisesWithMessage (ValueError ):
35- to_rna ('ACGTXXXCTTAA' )
36-
37- # Utility functions
38- def setUp (self ):
39- try :
40- self .assertRaisesRegex
41- except AttributeError :
42- self .assertRaisesRegex = self .assertRaisesRegexp
43-
44- def assertRaisesWithMessage (self , exception ):
45- return self .assertRaisesRegex (exception , r".+" )
46-
4725
4826if __name__ == '__main__' :
4927 unittest .main ()
0 commit comments