How to use __extract_tar_file method in webdriver_manager

Best Python code snippet using webdriver_manager

archive.py

Source:archive.py Github

copy

Full Screen

...6 def unpack(self, directory):7 if self.file_path.endswith(".zip"):8 return self.__extract_zip(directory)9 elif self.file_path.endswith(".tar.gz"):10 return self.__extract_tar_file(directory)11 def __extract_zip(self, to_directory):12 archive = zipfile.ZipFile(self.file_path)13 try:14 archive.extractall(to_directory)15 except Exception as e:16 if e.args[0] not in [26, 13] and e.args[1] not in ['Text file busy', 'Permission denied']:17 raise e18 return archive.namelist()19 def __extract_tar_file(self, to_directory):20 try:21 tar = tarfile.open(self.file_path, mode="r:gz")22 except tarfile.ReadError:23 tar = tarfile.open(self.file_path, mode="r:bz2")24 members = tar.getmembers()25 tar.extractall(to_directory)26 tar.close()...

Full Screen

Full Screen

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 webdriver_manager 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