How to use _fetch_asset method in avocado

Best Python code snippet using avocado_python

pebble_artifacts.py

Source:pebble_artifacts.py Github

copy

Full Screen

...7PEBBLE_VERSION = 'v2.2.1'8ASSETS_PATH = pkg_resources.resource_filename('certbot_integration_tests', 'assets')9def fetch(workspace):10 suffix = 'linux-amd64' if os.name != 'nt' else 'windows-amd64.exe'11 pebble_path = _fetch_asset('pebble', suffix)12 challtestsrv_path = _fetch_asset('pebble-challtestsrv', suffix)13 pebble_config_path = _build_pebble_config(workspace)14 return pebble_path, challtestsrv_path, pebble_config_path15def _fetch_asset(asset, suffix):16 asset_path = os.path.join(ASSETS_PATH, '{0}_{1}_{2}'.format(asset, PEBBLE_VERSION, suffix))17 if not os.path.exists(asset_path):18 asset_url = ('https://github.com/letsencrypt/pebble/releases/download/{0}/{1}_{2}'19 .format(PEBBLE_VERSION, asset, suffix))20 response = requests.get(asset_url)21 response.raise_for_status()22 with open(asset_path, 'wb') as file_h:23 file_h.write(response.content)24 os.chmod(asset_path, os.stat(asset_path).st_mode | stat.S_IEXEC)25 return asset_path26def _build_pebble_config(workspace):27 config_path = os.path.join(workspace, 'pebble-config.json')28 with open(config_path, 'w') as file_h:29 file_h.write(json.dumps({...

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