How to use test_metadata_header_character_decoding method in localstack

Best Python code snippet using localstack_python

test_s3.py

Source:test_s3.py Github

copy

Full Screen

...47 assert response["Body"].read() == b"foobar"48 response = s3_resource.Object(s3_bucket, "bar").get()49 assert response["Body"].read() == b"barfoo"50 @pytest.mark.aws_validated51 def test_metadata_header_character_decoding(self, s3_client, s3_bucket):52 # Object metadata keys should accept keys with underscores53 # https://github.com/localstack/localstack/issues/179054 # put object55 object_key = "key-with-metadata"56 metadata = {"TEST_META_1": "foo", "__meta_2": "bar"}57 s3_client.put_object(Bucket=s3_bucket, Key=object_key, Metadata=metadata, Body="foo")58 metadata_saved = s3_client.head_object(Bucket=s3_bucket, Key=object_key)["Metadata"]59 # note that casing is removed (since headers are case-insensitive)60 assert metadata_saved == {"test_meta_1": "foo", "__meta_2": "bar"}61 @pytest.mark.aws_validated62 def test_upload_file_multipart(self, s3_client, s3_bucket, tmpdir):63 key = "my-key"64 # https://boto3.amazonaws.com/v1/documentation/api/latest/guide/s3.html#multipart-transfers65 config = TransferConfig(multipart_threshold=5 * KB, multipart_chunksize=1 * KB)...

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run localstack automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful