-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Update protein-translation tests #1115
Update protein-translation tests #1115
Conversation
I've just seen this error - can someone let me know if there is a maximum line size, as this seems to be the error (but I'd like to check first) 🙂 |
Hi @sjwarner-bp, if you click through to Travis-CI using the "details" link in the bottom box, it will take you to an overview of the tests. You can then pick one of the Python versions (usually doesn't matter which) and then it will show an output of what's wrong. In your case, it looks like $ flake8
./exercises/protein-translation/protein_translation_test.py:7:1: E302 expected 2 blank lines, found 1
./exercises/protein-translation/protein_translation_test.py:49:80: E501 line too long (80 > 79 characters)
./exercises/protein-translation/protein_translation_test.py:54:80: E501 line too long (82 > 79 characters)
./exercises/protein-translation/protein_translation_test.py:59:80: E501 line too long (83 > 79 characters)
./exercises/protein-translation/protein_translation_test.py:61:33: E231 missing whitespace after ','
./exercises/protein-translation/protein_translation_test.py:61:44: E231 missing whitespace after ',' You can also install |
@N-Parsons (cc @sjwarner-bp )
I think you accidentally dropped an "8". Also note that path is optional and defaults to "./" 😄 |
Perfect - thanks for letting me know guys, I've installed it locally and will remember to use it in future! 🙂 |
@@ -35,25 +37,34 @@ def test_identifies_stop_codons(self): | |||
for codon in ['UAA', 'UAG', 'UGA']: | |||
self.assertEqual('STOP', of_codon(codon)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per discussion in exercism/problem-specifications#997, I don't think we should test for intermediate results. Thus, all tests should test of_rna()
(proteins()
in the spec).
@@ -35,25 +37,34 @@ def test_identifies_stop_codons(self): | |||
for codon in ['UAA', 'UAG', 'UGA']: | |||
self.assertEqual('STOP', of_codon(codon)) | |||
|
|||
def test_translates_rna_strand_into_correct_protein(self): | |||
def test_translates_rna_strand_into_correct_protein_list(self): | |||
strand = 'AUGUUUUGG' | |||
expected = ['Methionine', 'Phenylalanine', 'Tryptophan'] | |||
self.assertEqual(expected, of_rna(strand)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In an effort to maintain consistency with the spec, of_rna()
should probably be renamed to proteins()
.
Hi @cmccandless - just to double check so I don't make the wrong edits, all |
@sjwarner-bp Correct, however note that the tests that currently use |
Perfect, I understand you 😄 |
Sorry, I have just picked this up again after a hectic week! I'm trying to do this but running into trouble. Just to clarify, the things I need to do to satisfy this is:
So I have done the first two, but the final one is causing me a little confusion - do you have any guidance? |
@sjwarner-bp Have you tried simply renaming (in |
Hi @cmccandless , I have renamed |
@sjwarner-bp Can you please drop the contents of your |
Sure thing - here it is |
Don't forget to change from protein_translation import protein to from example import protein when running tests locally (revert before committing). |
Yup, done that - I still end up with 8 failing tests for some reason though 😱. I've tried the (previously) |
Make sure the tests that were previously |
Do you mean something like the following?
I've tried this (and then without the |
Sorry; I wasn't paying full attention to this and I didn't take the time to fully understand the inputs/outputs. According to the canonical data, here are a few notes:
See if any of that helps. I was able to make a few quick edits to your code to make it work, but you will benefit more from this if you figure it out yourself 😄 |
from protein_translation import of_codon, of_rna | ||
from protein_translation import proteins | ||
|
||
# Tests adapted from problem-specifications/canonical-data.json @ v1.0.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with other exercises, can you please change the spacing around this line? Should be 2 blank lines above, 1 below. (In the back of my mind I have a feeling I may have already said this, but switched the numbers; if so, I apologize for the misinformation)
@sjwarner-bp Merged. Thanks for working on this! |
Thanks for helping me out! |
Fixes #1103