How to use delete_consumer method in tempest

Best Python code snippet using tempest_python

test_consumer.py

Source: test_consumer.py Github

copy

Full Screen

...54 * whether the persona can update a55 """56 pass57 @abc.abstractmethod58 def test_identity_delete_consumer(self):59 """Test identity:delete_consumer policy.60 This test must check61 * whether the persona can delete a consumer62 """63 pass64class SystemAdminTests(65 IdentityV3RbacOauth1ConsumerTest, base.BaseIdentityTest):66 credentials = ['system_admin']67 def test_identity_create_consumer(self):68 resp = self.do_request('create_consumer',69 expected_status=201,70 **self.consumer())71 self.addCleanup(self.client.delete_consumer,72 resp['consumer']['id'])73 def test_identity_get_consumer(self):74 consumer = self.admin_client.create_consumer(75 **self.consumer())['consumer']76 self.addCleanup(self.admin_client.delete_consumer, consumer['id'])77 resp = self.do_request('show_consumer', consumer_id=consumer['id'])78 self.assertEqual(resp['consumer']['id'], consumer['id'])79 def test_identity_list_consumers(self):80 consumer = self.admin_client.create_consumer(81 **self.consumer())['consumer']82 self.addCleanup(self.admin_client.delete_consumer, consumer['id'])83 resp = self.do_request('list_consumers')84 self.assertIn(consumer['id'], set(c['id'] for c in resp['consumers']))85 def test_identity_update_consumer(self):86 consumer = self.client.create_consumer(**self.consumer())['consumer']87 self.addCleanup(self.client.delete_consumer, consumer['id'])88 self.do_request('update_consumer',89 consumer_id=consumer['id'],90 description=data_utils.arbitrary_string())91 def test_identity_delete_consumer(self):92 consumer = self.client.create_consumer(**self.consumer())['consumer']93 self.do_request('delete_consumer',94 expected_status=204,95 consumer_id=consumer['id'])96class SystemMemberTests(SystemAdminTests):97 credentials = ['system_member', 'system_admin']98 def test_identity_create_consumer(self):99 self.do_request('create_consumer',100 expected_status=exceptions.Forbidden,101 **self.consumer())102 def test_identity_update_consumer(self):103 consumer = self.admin_client.create_consumer(104 **self.consumer())['consumer']105 self.addCleanup(self.admin_client.delete_consumer, consumer['id'])106 self.do_request('update_consumer',107 expected_status=exceptions.Forbidden,108 consumer_id=consumer['id'],109 description=data_utils.arbitrary_string())110 def test_identity_delete_consumer(self):111 consumer = self.admin_client.create_consumer(112 **self.consumer())['consumer']113 self.do_request('delete_consumer',114 expected_status=exceptions.Forbidden,115 consumer_id=consumer['id'])116class SystemReaderTests(SystemMemberTests):117 credentials = ['system_reader', 'system_admin']118class DomainAdminTests(SystemMemberTests):119 credentials = ['domain_admin', 'system_admin']120 def test_identity_get_consumer(self):121 consumer = self.admin_client.create_consumer(122 **self.consumer())['consumer']123 self.addCleanup(self.admin_client.delete_consumer, consumer['id'])124 self.do_request('show_consumer',...

Full Screen

Full Screen

test_oauth_consumers_rbac.py

Source: test_oauth_consumers_rbac.py Github

copy

Full Screen

...35 self._create_consumer()36 @rbac_rule_validation.action(service="keystone",37 rule="identity:delete_consumer")38 @decorators.idempotent_id('0f148510-63bf-11e6-4522-080044d0d971')39 def test_delete_consumer(self):40 consumer = self._create_consumer()41 self.rbac_utils.switch_role(self, toggle_rbac_role=True)42 self.consumers_client.delete_consumer(consumer['id'])43 @rbac_rule_validation.action(service="keystone",44 rule="identity:update_consumer")45 @decorators.idempotent_id('0f148510-63bf-11e6-4522-080044d0d972')46 def test_update_consumer(self):47 consumer = self._create_consumer()48 new_description = data_utils.rand_name(49 self.__class__.__name__ + '-test_consumer')50 self.rbac_utils.switch_role(self, toggle_rbac_role=True)51 self.consumers_client.update_consumer(consumer['id'],52 new_description)53 @rbac_rule_validation.action(service="keystone",54 rule="identity:get_consumer")55 @decorators.idempotent_id('0f148510-63bf-11e6-4522-080044d0d973')56 def test_show_consumer(self):...

Full Screen

Full Screen

urls.py

Source: urls.py Github

copy

Full Screen

1from django.conf.urls import include, url2from django.contrib import admin3import sdios_lti.views4urlpatterns = [5 url(r"^$", sdios_lti.views.index, name="index"),6 url(r"^login/​$", sdios_lti.views.login, name="login"),7 url(r"^logout/​$", sdios_lti.views.logout, name="logout"),8 url(r"^sdis/​$", sdios_lti.views.view_environments, name="sdis"),9 url(r"^sdis/​export/​$", sdios_lti.views.export_environment, name="export_environment"),10 url(r"^sdis/​remove/​(?P<sdi_id>[0-9a-f]{8}-([0-9a-f]{4}-){3}[0-9a-f]{12})/​$", sdios_lti.views.remove_lti_access, name="remove_lti_access"),11 url(r"^consumers/​$", sdios_lti.views.view_consumers, name="consumers"),12 url(r"^consumers/​add_consumer/​$", sdios_lti.views.add_consumer, name="add_consumer"),13 url(r"^consumers/​delete_consumer/​$", sdios_lti.views.delete_consumer, name="delete_consumer"),14 url(r"^users/​$", sdios_lti.views.view_users, name="users"),15 url(r"^settings/​$", sdios_lti.views.manage_settings, name="settings"),16 url(r"^lti/​$", sdios_lti.views.lti, name="lti"),17 url(r"^admin/​", admin.site.urls, name="admin"),...

Full Screen

Full Screen

Blogs

Check out the latest blogs from LambdaTest on this topic:

Rebuild Confidence in Your Test Automation

These days, development teams depend heavily on feedback from automated tests to evaluate the quality of the system they are working on.

What will come after “agile”?

I think that probably most development teams describe themselves as being “agile” and probably most development teams have standups, and meetings called retrospectives.There is also a lot of discussion about “agile”, much written about “agile”, and there are many presentations about “agile”. A question that is often asked is what comes after “agile”? Many testers work in “agile” teams so this question matters to us.

Test strategy and how to communicate it

I routinely come across test strategy documents when working with customers. They are lengthy—100 pages or more—and packed with monotonous text that is routinely reused from one project to another. Yawn once more— the test halt and resume circumstances, the defect management procedure, entrance and exit criteria, unnecessary generic risks, and in fact, one often-used model replicates the requirements of textbook testing, from stress to systems integration.

Do you possess the necessary characteristics to adopt an Agile testing mindset?

To understand the agile testing mindset, we first need to determine what makes a team “agile.” To me, an agile team continually focuses on becoming self-organized and cross-functional to be able to complete any challenge they may face during a project.

How To Refresh Page Using Selenium C# [Complete Tutorial]

When working on web automation with Selenium, I encountered scenarios where I needed to refresh pages from time to time. When does this happen? One scenario is that I needed to refresh the page to check that the data I expected to see was still available even after refreshing. Another possibility is to clear form data without going through each input individually.

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