In this part of the assignment, you will write tests for your solutions in Part 0 and Part 1.
Like in Homework 1, we have provided a function called assert_equals
that takes an expected value and the value returned by your function, and compares them: if they don't match, the function will crash the program and tell you what was wrong. You can see more instructions an example for tests from the Homework 1 - Part 1 to see examples of how to call the tests.
One thing that is different from the last homework is the assert_equals
lives in a file called cse163_utils.py
. We imported the function in hw2_test.py
in a special way so this shouldn't change how you call assert_equals
. You should not modify anything in cse163_utils.py
.
For full credit, your hw2_test.py
must satisfy all of the following conditions:
hw2_manual.py
and hw2_pandas.py
that you were asked to write. It's okay to merge the test functions for the same problem in the different parts of the homework since their outputs are the same. There might be some redundancy in your tests which is expected since it's hard to factor out the different function calls and input types. You do not need a test for the parse
function in Part 1.assert_equals
.test_funky_sum
)