Monkeypatching __builtin__ in tests for mocking
I'm assuming you're fine with assert, generally I'd recommend using
the unittest
library.

Now for the monkey patching the other choice you have is to restructure
how the credentials are loaded.  At the moment the credentials are
loaded every time a request is performed - instead of that the
credentials could be loaded once, for the whole module as globals,
before invoking any other functionality.  Yes, globals are bad, but
unless you have another layer of indirection it'd be okay for this
purpose.

Done that way, you'd call e.g. ghdwn.load_credentials(), then issue
the call, then ghdwn.drop_credentials() and repeat.

If you stay with the current approach, I'd only move the patch method
out of the test into a proper function, as it's quite reusable, and give
it a better name maybe.

I'm not quite sure if there are other ways to open a file in Python,
regarding your concern whether you're actually testing the right thing;
it might also make sense to test two separate things: the function to
load credentials (from a custom path, so you can load from "/tmp/...")
and calling that function.  Then you wouldn't mock Python standard
functions, but instead only the credential loader, while you'd test the
loading of credentials with an actual test file.