refactored tests to use unittest.TestCase instead