That particular method you have to exercise with a temp file, but all other methods can avoid calling credentials_from_file, by setting the username and password directly.  In other words, you shouldn't need the TempCredFile except for the one tests for credentials_from_file.