MCPcopy Create free account
hub / github.com/apache/httpd / curl_upload_and_verify

Method curl_upload_and_verify

test/modules/http2/test_500_proxy.py:37–50  ·  view source on GitHub ↗
(self, env, fname, options=None)

Source from the content-addressed store, hash-verified

35
36 # upload and GET again using curl, compare to original content
37 def curl_upload_and_verify(self, env, fname, options=None):
38 url = env.mkurl("https", "cgi", "/proxy/upload.py")
39 fpath = os.path.join(env.gen_dir, fname)
40 r = env.curl_upload(url, fpath, options=options)
41 assert r.exit_code == 0
42 assert 200 <= r.response["status"] < 300
43
44 # why is the scheme wrong?
45 r2 = env.curl_get(re.sub(r'http:', 'https:', r.response["header"]["location"]))
46 assert r2.exit_code == 0
47 assert r2.response["status"] == 200
48 with open(self.local_src(fpath), mode='rb') as file:
49 src = file.read()
50 assert r2.response["body"] == src
51
52 @pytest.mark.parametrize("name", [
53 "data-1k", "data-10k", "data-100k", "data-1m",

Callers 2

test_h2_500_10Method · 0.95
test_h2_500_11Method · 0.95

Calls 5

local_srcMethod · 0.95
mkurlMethod · 0.80
joinMethod · 0.80
curl_uploadMethod · 0.80
curl_getMethod · 0.80

Tested by

no test coverage detected