Skip to content

rna-transcription: add invalid strand tests #1854

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions exercises/rna-transcription/rna_transcription_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@ def test_transcribes_adenine_to_uracil(self):
def test_transcribes_all_occurrences(self):
self.assertEqual(to_rna('ACGTGGTCTTAA'), 'UGCACCAGAAUU')

def test_invalid_nucleotide(self):
with self.assertRaises(ValueError):
to_rna('X')

def test_invalid_strand(self):
with self.assertRaises(ValueError):
to_rna('XYYP')

def test_partially_invalid_strand(self):
with self.assertRaises(ValueError):
to_rna('ACGTGGXYTCTTAAYP')


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