Best Python code snippet using tempest_python
test_volumes_backup.py
Source: test_volumes_backup.py
...33 return json.loads(base64.decode_as_text(backup_url))34 def _encode_backup(self, backup):35 retval = json.dumps(backup)36 return base64.encode_as_text(retval)37 def _modify_backup_url(self, backup_url, changes):38 backup = self._decode_url(backup_url)39 backup.update(changes)40 return self._encode_backup(backup)41 @decorators.idempotent_id('a99c54a1-dd80-4724-8a13-13bf58d4068d')42 def test_volume_backup_export_import(self):43 """Test backup export import functionality.44 Cinder allows exporting DB backup information through its API so it can45 be imported back in case of a DB loss.46 """47 volume = self.create_volume()48 # Create backup49 backup_name = data_utils.rand_name(self.__class__.__name__ + '-Backup')50 backup = (self.create_backup(backup_client=self.admin_backups_client,51 volume_id=volume['id'],52 name=backup_name))53 self.assertEqual(backup_name, backup['name'])54 # Export Backup55 export_backup = (self.admin_backups_client.export_backup(backup['id'])56 ['backup-record'])57 self.assertIn('backup_service', export_backup)58 self.assertIn('backup_url', export_backup)59 self.assertTrue(export_backup['backup_service'].startswith(60 'cinder.backup.drivers'))61 self.assertIsNotNone(export_backup['backup_url'])62 # NOTE(geguileo): Backups are imported with the same backup id63 # (important for incremental backups among other things), so we cannot64 # import the exported backup information as it is, because that Backup65 # ID already exists. So we'll fake the data by changing the backup id66 # in the exported backup DB info we have retrieved before importing it67 # back.68 new_id = data_utils.rand_uuid()69 new_url = self._modify_backup_url(70 export_backup['backup_url'], {'id': new_id})71 # Import Backup72 import_backup = self.admin_backups_client.import_backup(73 backup_service=export_backup['backup_service'],74 backup_url=new_url)['backup']75 # NOTE(geguileo): We delete both backups, but only one of those76 # deletions will delete data from the backup back-end because they77 # were both pointing to the same backend data.78 self.addCleanup(self._delete_backup, new_id)79 self.assertIn("id", import_backup)80 self.assertEqual(new_id, import_backup['id'])81 waiters.wait_for_backup_status(self.admin_backups_client,82 import_backup['id'], 'available')83 # Verify Import Backup...
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!!