Fixed style.

This commit is contained in:
Vladimir Chebotarev 2022-07-11 17:53:05 +03:00
parent 30bdc7e98f
commit f746187225
2 changed files with 10 additions and 8 deletions

View File

@ -22,7 +22,7 @@ def request(command, url, headers={}, data=None):
command,
urllib.parse.urlunparse(parts._replace(scheme="", netloc="")),
headers=headers,
body=data
body=data,
)
r = c.getresponse()
result = Dummy()
@ -55,13 +55,15 @@ class RequestHandler(http.server.BaseHTTPRequestHandler):
self.send_response(501)
self.send_header("Content-Type", "application/xml")
self.end_headers()
self.wfile.write(b"""<?xml version="1.0" encoding="UTF-8"?>
self.wfile.write(
b"""<?xml version="1.0" encoding="UTF-8"?>
<Error>
<Code>NotImplemented</Code>
<Message>Ima GCP and I can't do `DeleteObjects` request for ya. See https://issuetracker.google.com/issues/162653700 .</Message>
<Resource>RESOURCE</Resource>
<RequestId>REQUEST_ID</RequestId>
</Error>""")
</Error>"""
)
else:
self.do_HEAD()
@ -72,7 +74,7 @@ class RequestHandler(http.server.BaseHTTPRequestHandler):
self.command,
f"http://{UPSTREAM_HOST}{self.path}",
headers=self.headers,
data=data
data=data,
)
self.send_response(r.status_code)
for k, v in r.headers.items():

View File

@ -69,7 +69,7 @@ def run_s3_mocks(cluster):
logging.info("Starting s3 mocks")
mocks = (
("unstable_proxy.py", "resolver", "8081"),
("no_delete_objects.py", "resolver", "8082")
("no_delete_objects.py", "resolver", "8082"),
)
for mock_filename, container, port in mocks:
container_id = cluster.get_container_id(container)
@ -643,10 +643,10 @@ def test_s3_disk_restart_during_load(cluster, node_name):
@pytest.mark.parametrize("node_name", ["node"])
def test_s3_no_delete_objects(cluster, node_name):
node = cluster.instances[node_name]
create_table(node, "s3_test_no_delete_objects", storage_policy="no_delete_objects_s3")
node.query(
"DROP TABLE s3_test_no_delete_objects SYNC"
create_table(
node, "s3_test_no_delete_objects", storage_policy="no_delete_objects_s3"
)
node.query("DROP TABLE s3_test_no_delete_objects SYNC")
@pytest.mark.parametrize("node_name", ["node"])