Fix tests based on Python imports

The previous incarnation results in an unexpected indentation error.