Prevent tests from making network calls.

Copy a hack from dfb0daf