Skip to content

Commit 051950e

Browse files
mrcfpscmccandless
authored andcommitted
rna-transcription: update tests to v1.2.0 (exercism#1268)
* Update version number * Correct test class name from 'DNA' to 'RNA' * Fix typo in test case method name * Remove bad input tests
1 parent 1935444 commit 051950e

1 file changed

Lines changed: 3 additions & 25 deletions

File tree

exercises/rna-transcription/rna_transcription_test.py

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
from 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

4826
if __name__ == '__main__':
4927
unittest.main()

0 commit comments

Comments
 (0)