Cleanup test_credentials formatting

* pep8
* remove unused imports
* remove unused vars
* adding missing assertion to a test