Rewrite jstest in python