change test cases to unittest