Practicum 7: Testing, Testing, Testing
In Exercise 7.1, you wrote some simple unit tests for
the stock.py
module. This practicuum is simple—write unit tests
for some of your other modules:
-
Write unit tests for the
parse_csv()
function infileparse.py
-
Write unit tests for various
TableFormatter
classes intableformat.py
-
Write unit tests for functions in
report.py
Some of these tests will require a bit of thought because of their reliance on external files. Think about how you want to handle that. For example, perhaps it would make sense for a test to first create a temporary file to use as input for functions being tested.