rasterio
rasterio copied to clipboard
Skip network-dependent tests if no connection
Not a high priority but it would help in some cases like working on an airplane with ridiculously over-priced wifi
tests/test_env.py::test_s3_open_with_session FAILED
tests/test_env.py::test_s3_open_with_default_session FAILED
tests/test_env.py::test_open_https_vsicurl FAILED
tests/test_env.py::test_s3_rio_info FAILED
tests/test_env.py::test_https_rio_info FAILED
untested
try:
import http.client as httplib
except ImportError:
import httplib
def connected(host="www.example.com"):
conn = httplib.HTTPConnection(host)
try:
conn.request("HEAD", "/")
return True
except:
return False