Best Python code snippet using localstack_python
archive_test.py
Source:archive_test.py
...16 @classmethod17 def tearDownClass(cls):18 api.delete_resources_by_tag(TEST_TAG)19 @unittest.skipUnless(cloudinary.config().api_secret, "requires api_key/api_secret")20 def test_create_archive(self):21 """should successfully generate an archive"""22 result = uploader.create_archive(tags = [TEST_TAG])23 self.assertEqual(2, result.get("file_count"))24 result = uploader.create_zip(tags = [TEST_TAG], transformations = [{"width": 0.5},{"width": 2.0}])25 self.assertEqual(4, result.get("file_count"))26 @unittest.skipUnless(cloudinary.config().api_secret, "requires api_key/api_secret")27 def test_archive_url(self):28 result = utils.download_zip_url(tags = [TEST_TAG], transformations = [{"width": 0.5},{"width": 2.0}])29 response = urllib2.urlopen(result)30 temp_file = tempfile.NamedTemporaryFile()31 temp_file_name = temp_file.name32 temp_file.write(response.read())33 temp_file.flush()34 with zipfile.ZipFile(temp_file_name, 'r') as zip_file:...
test_preservation_service.py
Source:test_preservation_service.py
...28 def tearDown(self):29 yield self._stop_container()30 def test_instantiation_only(self):31 pass32 def test_create_archive(self):33 """34 Use fetcher service to create dataset so we can test without35 actual messaging.36 """37 raise unittest.SkipTest('Not implemented')...
test_helper.py
Source:test_helper.py
...14 def test_iglob(self):15 this_file = Path(__file__)16 py_files = _iglob("**/*.py", this_file.parent.parent)17 self.assertIn(this_file, list(py_files))18 def test_create_archive(self):19 this_file = Path(__file__)20 archive_file = NamedTemporaryFile(mode='w+b', suffix='.tbz2', delete=False)21 archive_file.close()22 self.addCleanup(lambda: os.remove(archive_file.name))23 create_archive(archive_file.name, this_file.parent, ["*.py", "-:_*"], verbose=True)24 with tarfile.open(archive_file.name, mode='r:bz2') as archive:25 self.assertIn(this_file.name, archive.getnames())...
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!!