Moved existing test cases from __main__ to unittest module