def test_https_success(): install(443) http = httplib2.Http() resp, content = http.request( 'https://some_hopefully_nonexistant_domain/', 'GET') assert wsgi_app.success() uninstall()
def test_simple_override(): http_install() http = httplib2.Http() resp, content = http.request( 'http://some_hopefully_nonexistant_domain:80/', 'GET') assert wsgi_app.success() http_uninstall()
def test_https_success(): install(443) http = httplib2.Http() resp, content = http.request('https://some_hopefully_nonexistant_domain/', 'GET') assert wsgi_app.success() uninstall()
def test_success(): install() http = httplib2.Http() resp, content = http.request( 'http://some_hopefully_nonexistant_domain:80/', 'GET') assert content == b'WSGI intercept successful!\n' assert wsgi_app.success() uninstall()
def test_https_success(): http_install(443) http_client = http_lib.HTTPSConnection('some_hopefully_nonexistant_domain') http_client.request('GET', '/') content = http_client.getresponse().read() assert content == b'WSGI intercept successful!\n' assert wsgi_app.success() http_uninstall(443)
def test_https_success(): http_install(443) http_client = http_lib.HTTPSConnection("some_hopefully_nonexistant_domain") http_client.request("GET", "/") content = http_client.getresponse().read() assert content == b"WSGI intercept successful!\n" assert wsgi_app.success() http_uninstall(443)
def test_https_success(): http_install(443) http_client = http.client.HTTPSConnection( 'some_hopefully_nonexistant_domain') http_client.request('GET', '/') content = http_client.getresponse().read() assert content == b'WSGI intercept successful!\n' assert wsgi_app.success() http_uninstall(443)
def test_https_default_port(): add_http_intercept(443) urllib_intercept.install_opener() urllib.request.urlopen('https://some_hopefully_nonexistant_domain/') assert wsgi_app.success() remove_intercept()
def test_https_success(): install(443) resp = requests.get('https://some_hopefully_nonexistant_domain/') assert resp.content == b'WSGI intercept successful!\n' assert wsgi_app.success() uninstall()
def test_http(): add_http_intercept() urllib_intercept.install_opener() url_lib.urlopen('http://some_hopefully_nonexistant_domain:80/') assert wsgi_app.success() remove_intercept()