Cleaned tests file to correct all pyflakes and pep8 errors

dia should probably be capitalized here (DIA)