refactor document class
add py.test files