How to use test_flavor_non_admin_set_keys method in tempest

Best Python code snippet using tempest_python

test_flavors_extra_specs_negative.py

Source:test_flavors_extra_specs_negative.py Github

copy

Full Screen

...49 resp, body = cls.client.delete_flavor(cls.flavor['id'])50 cls.client.wait_for_resource_deletion(cls.flavor['id'])51 super(FlavorsExtraSpecsNegativeTestJSON, cls).resource_cleanup()52 @test.attr(type=['negative', 'gate'])53 def test_flavor_non_admin_set_keys(self):54 # Test to SET flavor extra spec as a user without admin privileges.55 specs = {"key1": "value1", "key2": "value2"}56 self.assertRaises(exceptions.Unauthorized,57 self.flavors_client.set_flavor_extra_spec,58 self.flavor['id'],59 specs)60 @test.attr(type=['negative', 'gate'])61 def test_flavor_non_admin_update_specific_key(self):62 # non admin user is not allowed to update flavor extra spec63 specs = {"key1": "value1", "key2": "value2"}64 resp, body = self.client.set_flavor_extra_spec(65 self.flavor['id'], specs)66 self.assertEqual(resp.status, 200)67 self.assertEqual(body['key1'], 'value1')...

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 tempest 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