Best Python code snippet using tempest_python
test_logging.py
Source:test_logging.py
...34 policy.enforce(self.context, 'get_log', self.target))35 def test_update_log(self):36 self.assertTrue(37 policy.enforce(self.context, 'update_log', self.target))38 def test_delete_log(self):39 self.assertTrue(40 policy.enforce(self.context, 'delete_log', self.target))41class SystemMemberTests(LoggingAPITestCase):42 def setUp(self):43 super(SystemMemberTests, self).setUp()44 self.context = self.system_member_ctx45 def test_get_loggable_resource(self):46 self.assertTrue(47 policy.enforce(self.context, 'get_loggable_resource', self.target))48 def test_create_log(self):49 self.assertRaises(50 base_policy.PolicyNotAuthorized,51 policy.enforce, self.context, 'create_log', self.target)52 def test_get_log(self):53 self.assertTrue(54 policy.enforce(self.context, 'get_log', self.target))55 def test_update_log(self):56 self.assertRaises(57 base_policy.PolicyNotAuthorized,58 policy.enforce, self.context, 'update_log', self.target)59 def test_delete_log(self):60 self.assertRaises(61 base_policy.PolicyNotAuthorized,62 policy.enforce, self.context, 'delete_log', self.target)63class SystemReaderTests(SystemMemberTests):64 def setUp(self):65 super(SystemReaderTests, self).setUp()66 self.context = self.system_reader_ctx67class ProjectAdminTests(LoggingAPITestCase):68 def setUp(self):69 super(ProjectAdminTests, self).setUp()70 self.context = self.project_admin_ctx71 def test_get_loggable_resource(self):72 self.assertRaises(73 base_policy.InvalidScope,74 policy.enforce, self.context, 'get_loggable_resource', self.target)75 def test_create_log(self):76 self.assertRaises(77 base_policy.InvalidScope,78 policy.enforce, self.context, 'create_log', self.target)79 def test_get_log(self):80 self.assertRaises(81 base_policy.InvalidScope,82 policy.enforce, self.context, 'get_log', self.target)83 def test_update_log(self):84 self.assertRaises(85 base_policy.InvalidScope,86 policy.enforce, self.context, 'update_log', self.target)87 def test_delete_log(self):88 self.assertRaises(89 base_policy.InvalidScope,90 policy.enforce, self.context, 'delete_log', self.target)91class ProjectMemberTests(ProjectAdminTests):92 def setUp(self):93 super(ProjectMemberTests, self).setUp()94 self.context = self.project_member_ctx95class ProjectReaderTests(ProjectMemberTests):96 def setUp(self):97 super(ProjectReaderTests, self).setUp()...
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!!