How to use test_quotas method in tempest

Best Python code snippet using tempest_python

test_quotas.py

Source:test_quotas.py Github

copy

Full Screen

...15Functional tests for `shade` quotas methods.16"""17from shade.tests.functional import base18class TestComputeQuotas(base.BaseFunctionalTestCase):19 def test_quotas(self):20 '''Test quotas functionality'''21 quotas = self.operator_cloud.get_compute_quotas('demo')22 cores = quotas['cores']23 self.operator_cloud.set_compute_quotas('demo', cores=cores + 1)24 self.assertEqual(25 cores + 1,26 self.operator_cloud.get_compute_quotas('demo')['cores'])27 self.operator_cloud.delete_compute_quotas('demo')28 self.assertEqual(29 cores, self.operator_cloud.get_compute_quotas('demo')['cores'])30class TestVolumeQuotas(base.BaseFunctionalTestCase):31 def setUp(self):32 super(TestVolumeQuotas, self).setUp()33 if not self.operator_cloud.has_service('volume'):34 self.skipTest('volume service not supported by cloud')35 def test_quotas(self):36 '''Test quotas functionality'''37 quotas = self.operator_cloud.get_volume_quotas('demo')38 volumes = quotas['volumes']39 self.operator_cloud.set_volume_quotas('demo', volumes=volumes + 1)40 self.assertEqual(41 volumes + 1,42 self.operator_cloud.get_volume_quotas('demo')['volumes'])43 self.operator_cloud.delete_volume_quotas('demo')44 self.assertEqual(45 volumes,46 self.operator_cloud.get_volume_quotas('demo')['volumes'])47class TestNetworkQuotas(base.BaseFunctionalTestCase):48 def setUp(self):49 super(TestNetworkQuotas, self).setUp()50 if not self.operator_cloud.has_service('network'):51 self.skipTest('network service not supported by cloud')52 def test_quotas(self):53 '''Test quotas functionality'''54 quotas = self.operator_cloud.get_network_quotas('demo')55 network = quotas['network']56 self.operator_cloud.set_network_quotas('demo', network=network + 1)57 self.assertEqual(58 network + 1,59 self.operator_cloud.get_network_quotas('demo')['network'])60 self.operator_cloud.delete_network_quotas('demo')61 self.assertEqual(62 network,...

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