|
8 | 8 | class ProteinTranslationTests(unittest.TestCase):
|
9 | 9 |
|
10 | 10 | def test_AUG_translates_to_methionine(self):
|
11 |
| - self.assertEqual(['Methionine'], proteins('AUG')) |
| 11 | + self.assertEqual(proteins('AUG'), ['Methionine']) |
12 | 12 |
|
13 | 13 | def test_identifies_Phenylalanine_codons(self):
|
14 | 14 | for codon in ['UUU', 'UUC']:
|
15 |
| - self.assertEqual(['Phenylalanine'], proteins(codon)) |
| 15 | + self.assertEqual(proteins(codon), ['Phenylalanine']) |
16 | 16 |
|
17 | 17 | def test_identifies_Leucine_codons(self):
|
18 | 18 | for codon in ['UUA', 'UUG']:
|
19 |
| - self.assertEqual(['Leucine'], proteins(codon)) |
| 19 | + self.assertEqual(proteins(codon), ['Leucine']) |
20 | 20 |
|
21 | 21 | def test_identifies_Serine_codons(self):
|
22 | 22 | for codon in ['UCU', 'UCC', 'UCA', 'UCG']:
|
23 |
| - self.assertEqual(['Serine'], proteins(codon)) |
| 23 | + self.assertEqual(proteins(codon), ['Serine']) |
24 | 24 |
|
25 | 25 | def test_identifies_Tyrosine_codons(self):
|
26 | 26 | for codon in ['UAU', 'UAC']:
|
27 |
| - self.assertEqual(['Tyrosine'], proteins(codon)) |
| 27 | + self.assertEqual(proteins(codon), ['Tyrosine']) |
28 | 28 |
|
29 | 29 | def test_identifies_Cysteine_codons(self):
|
30 | 30 | for codon in ['UGU', 'UGC']:
|
31 |
| - self.assertEqual(['Cysteine'], proteins(codon)) |
| 31 | + self.assertEqual(proteins(codon), ['Cysteine']) |
32 | 32 |
|
33 | 33 | def test_identifies_Tryptophan_codons(self):
|
34 |
| - self.assertEqual(['Tryptophan'], proteins('UGG')) |
| 34 | + self.assertEqual(proteins('UGG'), ['Tryptophan']) |
35 | 35 |
|
36 | 36 | def test_identifies_stop_codons(self):
|
37 | 37 | for codon in ['UAA', 'UAG', 'UGA']:
|
38 |
| - self.assertEqual([], proteins(codon)) |
| 38 | + self.assertEqual(proteins(codon), []) |
39 | 39 |
|
40 | 40 | def test_translates_rna_strand_into_correct_protein_list(self):
|
41 | 41 | strand = 'AUGUUUUGG'
|
42 | 42 | expected = ['Methionine', 'Phenylalanine', 'Tryptophan']
|
43 |
| - self.assertEqual(expected, proteins(strand)) |
| 43 | + self.assertEqual(proteins(strand), expected) |
44 | 44 |
|
45 | 45 | def test_stops_translation_if_stop_codon_at_beginning_of_sequence(self):
|
46 | 46 | strand = 'UAGUGG'
|
47 | 47 | expected = []
|
48 |
| - self.assertEqual(expected, proteins(strand)) |
| 48 | + self.assertEqual(proteins(strand), expected) |
49 | 49 |
|
50 | 50 | def test_stops_translation_if_stop_codon_at_end_of_two_codon_sequence(
|
51 | 51 | self):
|
52 | 52 | strand = 'UGGUAG'
|
53 | 53 | expected = ['Tryptophan']
|
54 |
| - self.assertEqual(expected, proteins(strand)) |
| 54 | + self.assertEqual(proteins(strand), expected) |
55 | 55 |
|
56 | 56 | def test_stops_translation_if_stop_codon_at_end_of_three_codon_sequence(
|
57 | 57 | self):
|
58 | 58 | strand = 'AUGUUUUAA'
|
59 | 59 | expected = ['Methionine', 'Phenylalanine']
|
60 |
| - self.assertEqual(expected, proteins(strand)) |
| 60 | + self.assertEqual(proteins(strand), expected) |
61 | 61 |
|
62 | 62 | def test_stops_translation_if_stop_codon_in_middle_of_six_codon_sequence(
|
63 | 63 | self):
|
64 | 64 | strand = 'UGGUGUUAUUAAUGGUUU'
|
65 | 65 | expected = ['Tryptophan', 'Cysteine', 'Tyrosine']
|
66 |
| - self.assertEqual(expected, proteins(strand)) |
| 66 | + self.assertEqual(proteins(strand), expected) |
67 | 67 |
|
68 | 68 | # Utility functions
|
69 | 69 | def setUp(self):
|
|
0 commit comments