(self, env, fname, options=None)
| 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", |
no test coverage detected