Best Python code snippet using tempest_python
test_bug_1835822.py
Source: test_bug_1835822.py
...67 def _shelve_server(self, active_server):68 self.api.post_server_action(active_server['id'], {'shelve': {}})69 return self._wait_for_state_change(70 self.api, active_server, 'SHELVED_OFFLOADED')71 def _unshelve_server(self, shelved_server):72 self.api.post_server_action(shelved_server['id'], {'unshelve': {}})73 return self._wait_for_state_change(self.api, shelved_server, 'ACTIVE')74 # ---------------------------- tests ----------------------------75 def test_create_server_with_config_drive(self):76 """Verify that we can create a server with a config drive.77 """78 active_server = self._create_active_server(79 server_args={'config_drive': True})80 self.assertTrue(active_server['config_drive'])81 def test_create_server_without_config_drive(self):82 """Verify that we can create a server without83 a config drive.84 """85 self.flags(force_config_drive=False)86 active_server = self._create_active_server()87 self.assertEqual('', active_server['config_drive'])88 def test_create_server_with_forced_config_drive(self):89 """Verify that we can create a server with a forced90 config drive.91 """92 self.flags(force_config_drive=True)93 active_server = self._create_active_server()94 self.assertTrue(active_server['config_drive'])95 def test_create_server_with_forced_config_drive_reboot(self):96 """Verify that we can create a server with a forced97 config drive and it survives reboot.98 """99 self.flags(force_config_drive=True)100 active_server = self._create_active_server()101 self.assertTrue(active_server['config_drive'])102 active_server = self._hard_reboot_server(active_server)103 self.assertTrue(active_server['config_drive'])104 def test_create_server_config_drive_reboot_after_conf_change(self):105 """Verify that we can create a server with or without a forced106 config drive it does not change across a reboot.107 """108 # NOTE(sean-k-mooney): we do not need to restart the compute109 # service because of the way self.flags overrides the config110 # values.111 self.flags(force_config_drive=True)112 with_config_drive = self._create_active_server()113 self.assertTrue(with_config_drive['config_drive'])114 self.flags(force_config_drive=False)115 without_config_drive = self._create_active_server()116 self.assertEqual('', without_config_drive['config_drive'])117 # this server was created with force_config_drive=true118 # so assert now that force_config_drive is false it does119 # not override the value it was booted with.120 with_config_drive = self._hard_reboot_server(with_config_drive)121 self.assertTrue(with_config_drive['config_drive'])122 # this server was booted with force_config_drive=False so123 # assert that it's config drive setting is not overridden124 self.flags(force_config_drive=True)125 without_config_drive = self._hard_reboot_server(without_config_drive)126 self.assertEqual('', without_config_drive['config_drive'])127 def test_create_server_config_drive_rebuild_after_conf_change(self):128 """Verify that we can create a server with or without a forced129 config drive it does not change across a rebuild.130 """131 self.flags(force_config_drive=True)132 with_config_drive = self._create_active_server()133 self.assertTrue(with_config_drive['config_drive'])134 self.flags(force_config_drive=False)135 without_config_drive = self._create_active_server()136 self.assertEqual('', without_config_drive['config_drive'])137 # this server was created with force_config_drive=true138 # so assert now that force_config_drive is false it does139 # not override the value it was booted with.140 with_config_drive = self._rebuild_server(with_config_drive)141 self.assertTrue(with_config_drive['config_drive'])142 # this server was booted with force_config_drive=False so143 # assert that it's config drive setting is not overridden144 self.flags(force_config_drive=True)145 without_config_drive = self._rebuild_server(without_config_drive)146 self.assertEqual('', without_config_drive['config_drive'])147 def test_create_server_config_drive_shelve_unshelve_conf_change(self):148 """Verify that we can create a server with or without a forced149 config drive it does not change across a shelve and unshelve.150 """151 self.flags(force_config_drive=True)152 with_config_drive = self._create_active_server()153 self.assertTrue(with_config_drive['config_drive'])154 self.flags(force_config_drive=False)155 without_config_drive = self._create_active_server()156 self.assertEqual('', without_config_drive['config_drive'])157 # this server was created with force_config_drive=true158 # so assert now that force_config_drive is false it does159 # not override the value it was booted with.160 with_config_drive = self._shelve_server(with_config_drive)161 with_config_drive = self._unshelve_server(with_config_drive)162 self.assertTrue(with_config_drive['config_drive'])163 # this server was booted with force_config_drive=False so164 # assert that it's config drive setting is not overridden165 self.flags(force_config_drive=True)166 without_config_drive = self._shelve_server(without_config_drive)167 without_config_drive = self._unshelve_server(without_config_drive)...
Check out the latest blogs from LambdaTest on this topic:
These days, development teams depend heavily on feedback from automated tests to evaluate the quality of the system they are working on.
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.
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.
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.
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.
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!!