Skip to content

Commit 51969b5

Browse files
committed
protein-translation: adjust assertion param order (exercism#441)
1 parent 96027e1 commit 51969b5

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

exercises/protein-translation/protein_translation_test.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,62 +8,62 @@
88
class ProteinTranslationTests(unittest.TestCase):
99

1010
def test_AUG_translates_to_methionine(self):
11-
self.assertEqual(['Methionine'], proteins('AUG'))
11+
self.assertEqual(proteins('AUG'), ['Methionine'])
1212

1313
def test_identifies_Phenylalanine_codons(self):
1414
for codon in ['UUU', 'UUC']:
15-
self.assertEqual(['Phenylalanine'], proteins(codon))
15+
self.assertEqual(proteins(codon), ['Phenylalanine'])
1616

1717
def test_identifies_Leucine_codons(self):
1818
for codon in ['UUA', 'UUG']:
19-
self.assertEqual(['Leucine'], proteins(codon))
19+
self.assertEqual(proteins(codon), ['Leucine'])
2020

2121
def test_identifies_Serine_codons(self):
2222
for codon in ['UCU', 'UCC', 'UCA', 'UCG']:
23-
self.assertEqual(['Serine'], proteins(codon))
23+
self.assertEqual(proteins(codon), ['Serine'])
2424

2525
def test_identifies_Tyrosine_codons(self):
2626
for codon in ['UAU', 'UAC']:
27-
self.assertEqual(['Tyrosine'], proteins(codon))
27+
self.assertEqual(proteins(codon), ['Tyrosine'])
2828

2929
def test_identifies_Cysteine_codons(self):
3030
for codon in ['UGU', 'UGC']:
31-
self.assertEqual(['Cysteine'], proteins(codon))
31+
self.assertEqual(proteins(codon), ['Cysteine'])
3232

3333
def test_identifies_Tryptophan_codons(self):
34-
self.assertEqual(['Tryptophan'], proteins('UGG'))
34+
self.assertEqual(proteins('UGG'), ['Tryptophan'])
3535

3636
def test_identifies_stop_codons(self):
3737
for codon in ['UAA', 'UAG', 'UGA']:
38-
self.assertEqual([], proteins(codon))
38+
self.assertEqual(proteins(codon), [])
3939

4040
def test_translates_rna_strand_into_correct_protein_list(self):
4141
strand = 'AUGUUUUGG'
4242
expected = ['Methionine', 'Phenylalanine', 'Tryptophan']
43-
self.assertEqual(expected, proteins(strand))
43+
self.assertEqual(proteins(strand), expected)
4444

4545
def test_stops_translation_if_stop_codon_at_beginning_of_sequence(self):
4646
strand = 'UAGUGG'
4747
expected = []
48-
self.assertEqual(expected, proteins(strand))
48+
self.assertEqual(proteins(strand), expected)
4949

5050
def test_stops_translation_if_stop_codon_at_end_of_two_codon_sequence(
5151
self):
5252
strand = 'UGGUAG'
5353
expected = ['Tryptophan']
54-
self.assertEqual(expected, proteins(strand))
54+
self.assertEqual(proteins(strand), expected)
5555

5656
def test_stops_translation_if_stop_codon_at_end_of_three_codon_sequence(
5757
self):
5858
strand = 'AUGUUUUAA'
5959
expected = ['Methionine', 'Phenylalanine']
60-
self.assertEqual(expected, proteins(strand))
60+
self.assertEqual(proteins(strand), expected)
6161

6262
def test_stops_translation_if_stop_codon_in_middle_of_six_codon_sequence(
6363
self):
6464
strand = 'UGGUGUUAUUAAUGGUUU'
6565
expected = ['Tryptophan', 'Cysteine', 'Tyrosine']
66-
self.assertEqual(expected, proteins(strand))
66+
self.assertEqual(proteins(strand), expected)
6767

6868
# Utility functions
6969
def setUp(self):

0 commit comments

Comments
 (0)