Add Cython test case
Refactor common test code, add more test cases