refactoring tests into UnitTests, putting them in __main__