How to use get_test_providers_dir method in autotest

Best Python code snippet using autotest_python

asset.py

Source: asset.py Github

copy

Full Screen

...20 Get the names of all test providers available in test-providers.d.21 :return: List with the names of all test providers.22 """23 provider_name_list = []24 provider_dir = data_dir.get_test_providers_dir()25 for provider in glob.glob(os.path.join(provider_dir, '*.ini')):26 provider_name = os.path.basename(provider).split('.')[0]27 provider_info = get_test_provider_info(provider_name)28 if backend is not None:29 if backend in provider_info['backends']:30 provider_name_list.append(provider_name)31 else:32 provider_name_list.append(provider_name)33 return provider_name_list34def get_test_provider_subdirs(backend=None):35 """36 Get information of all test provider subdirs for a given backend.37 If no backend is provided, return all subdirs with tests.38 :param backend: Backend type, such as 'qemu'.39 :return: List of directories that contain tests for the given backend.40 """41 subdir_list = []42 for provider_name in get_test_provider_names():43 provider_info = get_test_provider_info(provider_name)44 backends_info = provider_info['backends']45 if backend is not None:46 if backend in backends_info:47 subdir_list.append(backends_info[backend]['path'])48 else:49 for b in backends_info:50 subdir_list.append(backends_info[b]['path'])51 return subdir_list52def get_test_provider_info(provider):53 """54 Get a dictionary with relevant test provider info, such as:55 * provider uri (git repo or filesystem location)56 * provider git repo data, such as branch, ref, pubkey57 * backends that this provider has tests for. For each backend type the58 provider has tests for, the 'path' will be also available.59 :param provider: Test provider name, such as 'io-github-autotest-qemu'.60 """61 provider_info = {}62 provider_path = os.path.join(data_dir.get_test_providers_dir(),63 '%s.ini' % provider)64 provider_cfg = test_config.config_loader(provider_path)65 provider_info['name'] = provider66 provider_info['uri'] = provider_cfg.get('provider', 'uri')67 provider_info['branch'] = provider_cfg.get('provider', 'branch', 'master')68 provider_info['ref'] = provider_cfg.get('provider', 'ref')69 provider_info['pubkey'] = provider_cfg.get('provider', 'pubkey')70 provider_info['backends'] = {}71 for backend in get_known_backends():72 subdir = provider_cfg.get(backend, 'subdir')73 if subdir is not None:74 if provider_info['uri'].startswith('file:/​/​'):75 src = os.path.join(provider_info['uri'][7:],76 subdir)...

Full Screen

Full Screen

data_dir.py

Source: data_dir.py Github

copy

Full Screen

...99TEST_PROVIDERS_DOWNLOAD_DIR = os.path.join(get_data_dir(), 'test-providers.d',100 'downloads')101def get_base_test_providers_dir():102 return TEST_PROVIDERS_DIR103def get_test_providers_dir():104 """105 Return the base test providers dir (at the moment, test-providers.d).106 """107 return os.path.dirname(TEST_PROVIDERS_DOWNLOAD_DIR)108def get_test_provider_dir(provider):109 """110 Return a specific test providers dir, inside the base dir.111 """112 return os.path.join(TEST_PROVIDERS_DOWNLOAD_DIR, provider)113def clean_tmp_files():114 tmp_dir = get_tmp_dir()115 if os.path.isdir(tmp_dir):116 hidden_paths = glob.glob(os.path.join(tmp_dir, ".??*"))117 paths = glob.glob(os.path.join(tmp_dir, "*"))...

Full Screen

Full Screen

Blogs

Check out the latest blogs from LambdaTest on this topic:

Keeping Quality Transparency Throughout the organization

In general, software testers have a challenging job. Software testing is frequently the final significant activity undertaken prior to actually delivering a product. Since the terms “software” and “late” are nearly synonymous, it is the testers that frequently catch the ire of the whole business as they try to test the software at the end. It is the testers who are under pressure to finish faster and deem the product “release candidate” before they have had enough opportunity to be comfortable. To make matters worse, if bugs are discovered in the product after it has been released, everyone looks to the testers and says, “Why didn’t you spot those bugs?” The testers did not cause the bugs, but they must bear some of the guilt for the bugs that were disclosed.

The Art of Testing the Untestable

It’s strange to hear someone declare, “This can’t be tested.” In reply, I contend that everything can be tested. However, one must be pleased with the outcome of testing, which might include failure, financial loss, or personal injury. Could anything be tested when a claim is made with this understanding?

How To Automate iOS App Using Appium

Mobile apps have been an inseparable part of daily lives. Every business wants to be part of the ever-growing digital world and stay ahead of the competition by developing unique and stable applications.

How To Write End-To-End Tests Using Cypress App Actions

When I started writing tests with Cypress, I was always going to use the user interface to interact and change the application’s state when running tests.

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