Unit Test Challenge Question
For this challenge question, you are going to test the zip
function you just wrote in the previous challenge question!
Part 0. Setup
Start by opening your workspace in Visual Studio. Right click on the “lessons” folder and select “add file”. Your file will be named zip_test.py
.
Set up your document by adding the docstring: """Test my zip function"""
and initializing the __author__
variable with your PID.
Also don’t forget to import your zip
function from lessons.zip
!
Part 1. unit tests
Write 3 unit tests for zip
. Remember that a unit test function name starts with test_
.
The 3 unit tests should consist of:
- One edge case
- Two use cases
Include descriptive function names and docstrings, so that it captures what is being tested.
Submission
Create a .zip file by running the following command in your terminal:
python -m tools.submission lessons
(For this assignment, you’ll have to submit your entire lessons folder!)
Then, drag and drop that .zip file into Gradescope!