refactored python tests

bulk of code in tests is still has same style