Refactor test_common.py to unittest style
Improve the documentation