How do you write a test for a function?
You import unittest and the module you're testing. Test class names usually end in TestCase; a prefix inficates what they test. The test class must be a child class of unittest.TestCase. Each test is a method. Every method that start with test__ runs when the tests run.