Sha256: 90dfca67029b773bf9ac5a8b181803935c4b3b0e60b2bf291b3dd9a699bde040

Contents?: true

Size: 1.04 KB

Versions: 144

Compression:

Stored size: 1.04 KB

Contents

import unittest

from rna_transcription import to_rna


# test cases adapted from `x-common//canonical-data.json` @ version: 1.0.0

class DNATests(unittest.TestCase):
    def test_transcribes_guanine_to_cytosine(self):
        self.assertEqual(to_rna('G'), 'C')

    def test_transcribes_cytosine_to_guanine(self):
        self.assertEqual(to_rna('C'), 'G')

    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):
        self.assertMultiLineEqual(to_rna('ACGTGGTCTTAA'), 'UGCACCAGAAUU')

    def test_correctly_handles_single_invalid_input(self):
        self.assertEqual(to_rna('U'), '')

    def test_correctly_handles_completely_invalid_input(self):
        self.assertMultiLineEqual(to_rna('XXX'), '')

    def test_correctly_handles_partially_invalid_input(self):
        self.assertMultiLineEqual(to_rna('ACGTXXXCTTAA'), '')


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

Version data entries

144 entries across 144 versions & 1 rubygems

Version Path
trackler-2.2.1.53 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.52 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.51 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.50 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.49 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.48 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.47 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.46 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.45 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.44 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.43 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.42 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.41 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.40 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.39 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.38 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.37 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.36 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.35 tracks/python/exercises/rna-transcription/rna_transcription_test.py
trackler-2.2.1.34 tracks/python/exercises/rna-transcription/rna_transcription_test.py