Cleaned tests file to correct all pyflakes and pep8 errors

This indentation appears to be inconsistent. Is flake8 throwing a warning?