Fix the Code 2 (Tests)
This is a follow up to Fix the Code 1.
Write tests for your Fix the Code 1
code for the following cases and
save it in a file called test_granger_analysis_code.py
(remember that
the file has to start with test_
for nose to find it). Make any
corrections/improvements that need to be made to the code so that all of
your tests pass.
gc_content()
- Sequence represented by upper case string
- Sequence represented by lower case string
- Sequence represented by mixed case string
- Sequence represented by multiline string
get_size_class()
In an email accompanying your “updated” code, Dr. Granger indicated that the specifications for the earlength size classes were:
- extralarge: earlength >= 15
- large: 10 <= earlength < 15
- medium: 8 <= earlength < 10
- small: earlength < 8
Write tests to check:
- that each case is working when the numbers are in the range,
- the edge cases of 8, 10, and 15, and
- what happens if non-numerical values are passed to the function (e.g., a string from a header row that didn’t get removed).