Refactoring test_check.py to use python unittest