MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / validate_upload

Function validate_upload

test/aws-localstack/mzcompose.py:277–286  ·  view source on GitHub ↗
(upload, expected_output_set)

Source from the content-addressed store, hash-verified

275 )
276
277 def validate_upload(upload, expected_output_set):
278 assert len(upload["Contents"]) > 0
279 output_lines = set()
280 for obj in upload["Contents"]:
281 assert obj["Key"].endswith(".csv")
282 key = obj["Key"]
283 object_response = s3_client.get_object(Bucket=bucket_name, Key=key)
284 body = object_response["Body"].read().decode("utf-8")
285 output_lines.update(body.splitlines())
286 assert output_lines == expected_output_set
287
288 # asserting the uploaded files
289 date = c.sql_query("SELECT TO_CHAR(now(), 'YYYY-MM-DD')")[0][0]

Callers 1

workflow_copy_to_s3Function · 0.85

Calls 5

get_objectMethod · 0.80
setFunction · 0.50
decodeMethod · 0.45
readMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected