making code pep8 and pyflakes compliant; correcting a func test