docs: Expand documentation on Internet access in tests.

This commit is contained in:
Tim Abbott
2017-07-04 13:13:38 -07:00
parent 5b81cc2bcd
commit b2ada7e706
3 changed files with 56 additions and 17 deletions

View File

@@ -118,9 +118,8 @@ def block_internet():
# httplib2 to access internet.
def internet_guard(*args, **kwargs):
# type: (*Any, **Any) -> None
raise Exception("Zulip doesn't allow network access to test suits. "
"You need to mock any network access calls in test"
"suits. Checkout our docs on testing here for details."
raise Exception("Outgoing network requests are not allowed in the Zulip tests. "
"More details and advice are available here:"
"https://zulip.readthedocs.io/en/latest/testing.html#internet-access-inside-test-suits")
httplib2.Http.request = internet_guard