improved the python test script