How to use _add_args method in tempest

Best Python code snippet using tempest_python

remote_registry_entry.py

Source:remote_registry_entry.py Github

copy

Full Screen

1from sys import platform2from typing import Optional, Any, List3from mlagents_envs.environment import UnityEnvironment4from mlagents_envs.base_env import BaseEnv5from mlagents_envs.registry.binary_utils import get_local_binary_path6from mlagents_envs.registry.base_registry_entry import BaseRegistryEntry7class RemoteRegistryEntry(BaseRegistryEntry):8 def __init__(9 self,10 identifier: str,11 expected_reward: Optional[float],12 description: Optional[str],13 linux_url: Optional[str],14 darwin_url: Optional[str],15 win_url: Optional[str],16 additional_args: Optional[List[str]] = None,17 ):18 """19 A RemoteRegistryEntry is an implementation of BaseRegistryEntry that uses a20 Unity executable downloaded from the internet to launch a UnityEnvironment.21 __Note__: The url provided must be a link to a `.zip` file containing a single22 compressed folder with the executable inside. There can only be one executable23 in the folder and it must be at the root of the folder.24 :param identifier: The name of the Unity Environment.25 :param expected_reward: The cumulative reward that an Agent must receive26 for the task to be considered solved.27 :param description: A description of the Unity Environment. Contains human28 readable information about potential special arguments that the make method can29 take as well as information regarding the observation, reward, actions,30 behaviors and number of agents in the Environment.31 :param linux_url: The url of the Unity executable for the Linux platform32 :param darwin_url: The url of the Unity executable for the OSX platform33 :param win_url: The url of the Unity executable for the Windows platform34 """35 super().__init__(identifier, expected_reward, description)36 self._linux_url = linux_url37 self._darwin_url = darwin_url38 self._win_url = win_url39 self._add_args = additional_args40 def make(self, **kwargs: Any) -> BaseEnv:41 """42 Returns the UnityEnvironment that corresponds to the Unity executable found at43 the provided url. The arguments passed to this method will be passed to the44 constructor of the UnityEnvironment (except for the file_name argument)45 """46 url = None47 if platform == "linux" or platform == "linux2":48 url = self._linux_url49 if platform == "darwin":50 url = self._darwin_url51 if platform == "win32":52 url = self._win_url53 if url is None:54 raise FileNotFoundError(55 f"The entry {self.identifier} does not contain a valid url for this "56 "platform"57 )58 path = get_local_binary_path(self.identifier, url)59 if "file_name" in kwargs:60 kwargs.pop("file_name")61 args: List[str] = []62 if "additional_args" in kwargs:63 if kwargs["additional_args"] is not None:64 args += kwargs["additional_args"]65 if self._add_args is not None:66 args += self._add_args67 kwargs["additional_args"] = args...

Full Screen

Full Screen

cli_arg_parser.py

Source:cli_arg_parser.py Github

copy

Full Screen

...4# https://docs.python.org/3/howto/argparse.html5class CLIArgParser(object):6 def __init__(self):7 self.parser = ArgumentParser()8 def _add_args(self):9 self.parser.add_argument('-f', '--file',10 type=str,11 help='Path to input file',12 default=DEFAULT_SAMPLE_FILE_PATH)13 def _parse_args(self):14 return self.parser.parse_args()15 def get_args(self):16 self._add_args()17 return self._parse_args()18 @classmethod19 def get_cli_args(cls):20 parser = cls()...

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