Best Python code snippet using tempest_python
test_container_acl_negative.py
Source:test_container_acl_negative.py
...104 self.assertRaises(exceptions.Unauthorized,105 self.custom_object_client.delete_object,106 self.container_name, object_name)107 @test.attr(type=['negative', 'smoke'])108 def test_read_object_without_rights(self):109 # attempt to read object using non-authorized user110 # update X-Container-Read metadata ACL111 cont_headers = {'X-Container-Read': 'badtenant:baduser'}112 resp_meta, body = self.container_client.update_container_metadata(113 self.container_name, metadata=cont_headers,114 metadata_prefix='')115 self.assertHeaders(resp_meta, 'Container', 'POST')116 # create object117 object_name = data_utils.rand_name(name='Object')118 resp, _ = self.object_client.create_object(self.container_name,119 object_name, 'data')120 self.assertHeaders(resp, 'Object', 'PUT')121 # Trying to read the object without rights122 self.custom_object_client.auth_provider.set_alt_auth_data(...
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!