python. Reorginized tests, fixed #167.