test: refactor using unittest