Added unittests to the test file.
fix unit tests when run as 'python -m unittest test'