How to use enable_namespace method in avocado

Best Python code snippet using avocado_python

python-app-loop-example-sub.py

Source:python-app-loop-example-sub.py Github

copy

Full Screen

1import os2import pysftp3import traceback4import time5from datetime import datetime6import pika7import pathlib8import uuid9import sys10##### Class #####11class sftp_CONN:12 # Ini13 def __init__(self):14 self.ResultAr = []15 self.remote_host = None16 self.port = None17 self.usr = None18 self.pwd = None19 self.src = None20 self.destPath = None21 self.conn = None22 return23 def __enter__(self):24 res = self.setup()25 pAr = self.to_list()26 return res27 def __exit__(self, type, value, traceback):28 self.close_conn()29 return30 def setup(self) -> None :31 self.from_env()32 conn = self.get_conn()33 return conn34 def from_env(self) -> None: #setAllParams(self):35 self.remote_host = self.set_env_param('SFTP_HOST',r'localhost')36 self.port = int(self.set_env_param('SFTP_PORT',r'22'))37 self.usr = self.set_env_param('SFTP_USR',r'admin')38 self.pwd = self.set_env_param('SFTP_PWD',r'pwd')39 self.src = self.set_env_param('SOURCE_PATH',r'/src')40 self.destPath = self.set_env_param('DEST_PATH',r'/trgt')41 c = pysftp.CnOpts()42 c.hostkeys = None43 self.cnopts = c44 def to_list(self):45 self.ResultAr.append(self.remote_host)46 self.ResultAr.append(self.port)47 self.ResultAr.append(self.usr)48 self.ResultAr.append(self.pwd)49 self.ResultAr.append(self.src)50 self.ResultAr.append(self.destPath)51 return self.ResultAr52 def set_env_param(self, paramName,defaultStr):53 param = os.getenv(paramName)54 res = defaultStr if not param else param55 return res56 def get_dir_list(self, scon, srcPath):57 # Set callback functions58 wtcb = pysftp.WTCallbacks()59 # Recursively map files60 scon.walktree(srcPath, fcallback=wtcb.file_cb, dcallback=wtcb.dir_cb, ucallback=wtcb.unk_cb)61 lAr = wtcb.flist62 return lAr63 def get_conn(self) -> pysftp.Connection:64 """65 Returns an SFTP connection object66 """67 if self.conn is None:68 cnopts = self.cnopts69 conn_params = {70 'host': self.remote_host,71 'port': self.port,72 'username': self.usr,73 'cnopts': cnopts74 }75 if self.pwd and self.pwd.strip():76 conn_params['password'] = self.pwd77 self.conn = pysftp.Connection(**conn_params)78 return self.conn79 def close_conn(self) -> None:80 """81 Closes the connection82 """83 if self.conn is not None:84 self.conn.close()85 self.conn = None86 def path_exists(self, path: str) -> bool:87 """88 Returns True if a remote entity exists89 :param path: full path to the remote file or directory90 :type path: str91 """92 conn = self.get_conn()93 return conn.exists(path)94 def create_directory(self, remote_directory: str) -> bool:95 """Change to this directory, recursively making new folders if needed.96 Returns True if any folders were created."""97 if self.conn is None:98 self.get_conn()99 sftp = self.conn100 if remote_directory == '/':101 # absolute path so change directory to root102 sftp.chdir('/')103 return104 if remote_directory == '':105 # top-level relative directory must exist106 return107 try:108 sftp.chdir(remote_directory) # sub-directory exists109 except IOError:110 dirname, basename = os.path.split(remote_directory.rstrip('/'))111 self.create_directory(dirname) # make parent directories112 sftp.mkdir(basename) # sub-directory missing, so created it113 sftp.chdir(basename)114 return True115 def download_file(self, locDir: str, remotePath: str) -> str:116 res = None117 if self.conn is None:118 self.get_conn()119 sftp = self.conn120 try:121 # Set local file paths122 rp = str(remotePath)123 p = pathlib.Path(rp.replace("b'", "").replace("'", ""))124 b = pathlib.Path(str(locDir))125 locPath = b.joinpath(p.name)126 # Copy files locally127 sftp.get(str(p), str(locPath))128 res = locPath129 except Exception as err:130 print()131 print("An error occurred while downloading file from SFTP server.")132 print(str(err))133 traceback.print_tb(err.__traceback__)134 return res135 def upload_file(self, locPath, remotePath) -> str:136 res = None137 if self.conn is None:138 self.get_conn()139 sftp = self.conn140 try:141 # Set local file paths142 rp = str(remotePath)143 locPath = str(locPath)144 rDir = pathlib.Path(rp).parent145 self.create_directory(rDir)146 # Copy files remotely147 sftp.put(locPath,rp)148 res = rp149 except Exception as err:150 print("An error occurred while uploading file to SFTP server.")151 print(str(err))152 traceback.print_tb(err.__traceback__)153 raise154 return res155 def delete_file(self, remotePath: str):156 if self.conn is None:157 self.get_conn()158 sftp = self.conn159 try:160 sftp.remove(remotePath)161 except Exception as err:162 print("An error occurred while deleting file from SFTP server.")163 print(str(err))164 traceback.print_tb(err.__traceback__)165 def append_file(self, remotePath_a, remotePath_b):166 if self.conn is None:167 self.get_conn()168 sftp = self.conn169 res = None170 try:171 # with sftp_conn.open(remotePath_a,'a') as f_a:172 with sftp.open(remotePath_b,'rb') as f_b:173 appStr = f_b.read().decode('utf-8') + '\n'174 remotePath_a.writelines(appStr)175 rp = str(remotePath_a)176 res = rp177 except Exception as err:178 print("An error occurred while appending text to file on SFTP server.")179 print(str(err))180 traceback.print_tb(err.__traceback__)181 return res182class queue_CONN:183 # Ini184 def __init__(self):185 # ini class attributes186 self.ResultAr = []187 self.rbt_srv = None188 self.queue_namespace = None189 self.src_queue = None190 self.dest_queue = None191 self.enable_namespace = None192 self.pub_limit = None193 self.in_conn = None194 self.out_conn = None195 # Create channels196 self.in_channel = None197 self.out_channel = None198 self.ns_channel = None199 return200 def __enter__(self):201 self.setup()202 pAr = self.to_list()203 return pAr204 def __exit__(self, type, value, traceback):205 self.close_all_connections()206 return207 def setup(self) -> None :208 self.from_env()209 self.create_named_channel_queues()210 return211 def _isAttribSet(self, attr) -> bool:212 res = False213 try: res = hasattr(self,attr)214 except Exception as err: res = False215 return res216 def from_env(self) -> None: #setAllParams(self):217 '''218 Set class parameters from environment variables or set development defaults219 '''220 default_ns = str(uuid.uuid4().hex)221 self.rbt_srv = self.set_env_param('RABBIT_SRV',r'rabbit-queue')222 self.queue_namespace = self.set_env_param('NAMESPACE',default_ns)223 self.src_queue = self.set_env_param('INPUT_QUEUE',r'new_files')224 self.dest_queue = self.set_env_param('OUTPUT_QUEUE',r'processed_files')225 self.enable_namespace = bool(int(self.set_env_param('ENABLE_NAMESPACE_QUEUE',r'0')))226 self.pub_limit = int(self.set_env_param('PUBLISHING_LIMIT','20'))227 return228 def to_list(self):229 '''230 Return class parameters as a list231 '''232 self.ResultAr.append(self.rbt_srv)233 self.ResultAr.append(self.queue_namespace)234 self.ResultAr.append(self.src_queue)235 self.ResultAr.append(self.dest_queue)236 return self.ResultAr237 def set_env_param(self, paramName: str,defaultStr: str) -> str:238 param = os.getenv(paramName)239 res = defaultStr if not param else param240 return res241 def set_input_function(self, input_func) -> None:242 self._input_func = input_func243 return244 # Channel Managment245 ## Named channels246 ### Create channels247 def create_namespace_queues(self, chObj, nsStr: str) -> None:248 self.success_queue = 'pass_' + nsStr249 self.fail_queue = 'fail_' + nsStr250 self.progress_queue = 'status_' + nsStr251 chObj.queue_declare(queue=self.success_queue, durable=True)252 chObj.queue_declare(queue=self.fail_queue, durable=True)253 chObj.queue_declare(queue=self.progress_queue, durable=True)254 return255 def create_named_channel_queues(self) -> None:256 # Create connections257 self.in_conn = self.open_Connection()258 self.out_conn = self.open_Connection()259 # Create channels260 self.in_channel = self.open_channel(self.in_conn)261 self.out_channel = self.open_channel(self.out_conn)262 self.ns_channel = self.open_channel(self.out_conn)263 # Create queues264 self.in_channel.queue_declare(queue=self.src_queue, durable=True)265 self.out_channel.queue_declare(queue=self.dest_queue, durable=True)266 if self.enable_namespace:267 ## Create namespace based queues268 self.create_namespace_queues(self.ns_channel, self.queue_namespace)269 return270 ### Start/Stop Input channel271 def start_input_stream(self) -> None:272 print(' [*] Starting input stream')273 if (self.in_channel is not None) and (self._input_func is not None):274 # if self._isAttribSet(self.in_channel) and self._isAttribSet(self._input_func):275 self.ip_consuming_tag = self.start_consuming(self.in_channel, self.src_queue, self._input_func)276 print(' [+] Input stream started with consumer_tag {0}'.format(str(self.ip_consuming_tag)))277 return278 def stop_input_stream(self) -> None:279 if (self.in_channel is not None) and (self.ip_consuming_tag is not None):280 # if self._isAttribSet('in_channel') and self._isAttribSet('ip_consuming_tag'):281 self.stop_consuming(self.in_channel, self.ip_consuming_tag)282 return283 ### Write to Output channel284 def write_output(self, op_msg: str) -> None:285 # Build in publish limiter286 if (self.out_channel is not None) and (self.dest_queue is not None):287 self.publish_message(self.out_channel, self.dest_queue,op_msg)288 return289 ## General channels290 ### Publish message to queue291 def publish_message(self, channel, queueName: str, op_msg: str) -> None:292 # Build in publish limiter293 channel.basic_publish(exchange='',294 routing_key=queueName,295 body=op_msg)296 return297 ### Start/Stop consumer298 def start_consuming(self, channel, queueName, func):299 if (channel is not None) and (queueName is not None) and (func is not None):300 ctag = self.in_channel.basic_consume(self.src_queue, self._input_func)301 channel.start_consuming()302 return ctag303 def stop_consuming(self, ch, ch_tag) -> None:304 ch.basic_cancel(ch_tag)305 return306 # Connection State307 def open_Connection(self):308 connection = (pika.BlockingConnection(309 parameters=pika.ConnectionParameters(self.rbt_srv)))310 return connection311 def open_channel(self, connObj):312 ch = connObj.channel()313 ch.basic_qos(prefetch_count=1)314 return ch315 def close_all_connections(self) -> None:316 self.close_connection(self.in_conn)317 self.close_connection(self.out_conn)318 return319 def close_connection(self, conn) -> None:320 if conn is not None:321 if conn.is_open:322 conn.close()323 return324 # Communicate status325 ## Write Success326 def write_success(self, op_msg: str) -> None:327 # Build in publish limiter328 if (self.enable_namespace) and (self.out_channel is not None) and (self.success_queue is not None):329 self.publish_message(self.out_channel, self.success_queue,op_msg)330 return331 ## Write Fault332 def write_fault(self, op_msg: str) -> None:333 # Build in publish limiter334 if (self.enable_namespace) and (self.out_channel is not None) and (self.fail_queue is not None):335 self.publish_message(self.out_channel, self.fail_queue,op_msg)336 return337 ## Write Status338 def write_status(self, op_msg: str) -> None:339 # Build in publish limiter340 if (self.enable_namespace) and (self.out_channel is not None) and (self.progress_queue is not None):341 self.publish_message(self.out_channel, self.progress_queue, op_msg)342 return343##### Function #####344def set_env_param(paramName,defaultStr):345 param = os.getenv(paramName)346 res = defaultStr if not param else param347 return res348def main():349 # Set sftp interface350 sftp_interface = sftp_CONN()351 # Set queue interface352 rbt_interface = queue_CONN()353 # Get frequency of app container354 frq = int(set_env_param('FREQUENCY_SEC','300'))355 # Get Application name356 app_name = set_env_param('APP_NAME',str(os.uname()[1]))357 msg_cnt = 0358 try:359 # Connect to SFTP server360 print(' [*] Connecting to SFTP server')361 with sftp_interface as sftp:362 print(' [+] Connected to SFTP server')363 # Connect to RabbitMQ server364 print(' [*] Connecting to RabbitMQ server')365 with rbt_interface as rbt_params:366 print(' [+] Connected to RabbitMQ')367 # Set input calback function368 def input_callback(ch, method, properties, msg):369 print(" [+] Received %r" % msg)370 try:371 # Do something cool372 print(msg)373 '''374 <! Something cool>375 '''376 # Ack message proc completion377 ch.basic_ack(delivery_tag=method.delivery_tag)378 # Register progress379 msg_cnt+=1380 rbt_interface.write_status(str(msg_cnt))381 except Exception as err:382 print(' [!] Error executing input stream {0}.'.format(app_name))383 # Report failure to fault channel384 fault_msg = app_name + ' | Timestamp:' + datetime.now().strftime("%d/%m/%Y %H:%M:%S")385 rbt_interface.write_fault(success_msg)386 # Register callback function and start input stream387 rbt_interface.set_input_function(input_callback)388 rbt_interface.start_input_stream()389 # Clean up connections390 # rbt_interface.close_all_connections()391 time.sleep(frq)392 # Report success393 success_msg = app_name + ' | Timestamp:' + datetime.now().strftime("%d/%m/%Y %H:%M:%S")394 rbt_interface.write_success(success_msg)395 except Exception as err:396 print()397 print("An error occurred while executing main proc.")398 print(str(err))399 traceback.print_tb(err.__traceback__)400 return401if __name__ == '__main__':402 try:403 main()404 except KeyboardInterrupt:405 print('Interrupted')406 try:407 sys.exit(0)408 except SystemExit:...

Full Screen

Full Screen

main.py

Source:main.py Github

copy

Full Screen

1import gen_test2from types import FunctionType3from typing import List4import gen_swizzle5import gen_type6import gen_math7import gen_dependency8import config9import shutil10import sys11import codegen_util as util12from pathlib import Path13# paths 14codgen_root_dir = Path(__file__).parent15project_root_dir = codgen_root_dir.parent16cpp_root_dir = project_root_dir / "FukoMath"17test_root_dir = project_root_dir / "FukoTest"18swizzle_dir = cpp_root_dir / "Swizzle"19types_dir = cpp_root_dir / "Types"20math_dir = cpp_root_dir / "Math"21# file paths 22make_script_path = project_root_dir / "premake.lua"23forward_file_path = cpp_root_dir / "fuko_math_forward.h"24deferred_file_path = cpp_root_dir / "fuko_math_deferred.h"25facade_file_path = cpp_root_dir / "fuko_math.h"26dependencies_file_path = cpp_root_dir / "fuko_math_dependencies.h"27# lists 28full_type_list = set(config.vector_type_list).union(config.matrix_type_list)29def begin_namespace() -> str:30 return str.format("namespace {math_namespace}\n{{\n", math_namespace = config.math_namespace)31def end_namespace() -> str:32 return "}"33if __name__ == "__main__" :34 # clean up dir 35 if cpp_root_dir.exists():36 shutil.rmtree(cpp_root_dir)37 if test_root_dir.exists():38 shutil.rmtree(test_root_dir)39 if make_script_path.exists():40 make_script_path.unlink()41 # clean up option 42 if "cleanup" in sys.argv:43 workspace_dir = project_root_dir / "workspace"44 if workspace_dir.exists():45 shutil.rmtree(workspace_dir)46 exit()47 # gen dir 48 swizzle_dir.mkdir(parents=True)49 types_dir.mkdir(parents=True)50 math_dir.mkdir(parents=True)51 test_root_dir.mkdir(parents=True)52 # copy swizzle.h 53 swizzle_template_path = codgen_root_dir / config.swizzle_template_path54 if swizzle_template_path.exists():55 swizzle_template : str56 with swizzle_template_path.open() as f:57 swizzle_template = f.read()58 with (swizzle_dir / "swizzle.h").open("w+") as f:59 f.write(swizzle_template.format(60 inline_marco = config.inline_marco61 , math_namespace = config.math_namespace))62 else:63 print("lost swizzle template file\n")64 exit()65 # gen vector swizzle 66 for src_size in range(2, 5):67 with (swizzle_dir / str.format("swizzle{size}", size = src_size)).open("w+") as f:68 f.write('#include "swizzle.h"')69 f.write(gen_swizzle.gen_swizzle_code_vector(src_size))70 # gen matrix swizzle 71 if config.enable_matrix_swizzle:72 for row_size in range(1, 5):73 for col_size in range(1, 5):74 if row_size != 1 or col_size != 1:75 with (swizzle_dir / str.format("swizzle{row}x{col}", row = row_size, col = col_size)).open("w+") as f:76 f.write('#include "swizzle.h"')77 f.write(gen_swizzle.gen_swizzle_code_matrix(row_size, col_size))78 # gen forward file 79 forward_template_file_path = codgen_root_dir / config.forward_file_template_path80 if forward_template_file_path.exists():81 forward_template : str 82 # read template 83 with forward_template_file_path.open() as f:84 forward_template = f.read()85 86 # write 87 with forward_file_path.open("w+") as f:88 f.write(str.format(forward_template89 , forward_declares = gen_type.gen_forward_declare_vector(config.vector_type_list) 90 + gen_type.gen_forward_declare_matrix(config.matrix_type_list)91 , math_namespace = config.math_namespace))92 else:93 print("lost forward template file\n")94 exit()95 96 # gen type codes 97 for type in full_type_list:98 implicit_types = config.vector_type_list.copy()99 implicit_types.remove(type)100 # write file 101 with (types_dir / (type + ".h")).open("w+") as f:102 f.write('''#pragma once\n#include "../fuko_math_forward.h"\n#include "../Swizzle/swizzle.h"\n\n''')103 104 # begin namespace 105 if config.enable_namespace:106 f.write(begin_namespace())107 108 # gen vector codes 109 if type in config.vector_type_list:110 f.write(gen_type.gen_type_code_vector(type, implicit_types))111 # gen matrix types112 if type in config.matrix_type_list:113 f.write(gen_type.gen_type_code_matrix(type))114 # end namespace 115 if config.enable_namespace:116 f.write(end_namespace())117 118 # gen dependencies 119 with dependencies_file_path.open("w+") as f:120 # add pragma and forward 121 f.write('''#pragma once\n#include "fuko_math_forward.h"\n''')122 123 # add type include 124 for type in config.vector_type_list:125 f.write(str.format('''#include "Types/{type}.h"\n''', type = type))126 f.write("\n")127 # begin namespace 128 if config.enable_namespace:129 f.write(begin_namespace())130 # implicit convertions 131 f.write(gen_dependency.gen_implicit_conversion(config.vector_type_list))132 # asxxx convertions 133 f.write(gen_dependency.gen_asxxx_conversion(config.asxxx_type_list))134 # end namespace 135 if config.enable_namespace:136 f.write(end_namespace())137 # gen deferred file 138 deferred_template_file_path = codgen_root_dir / config.deferred_file_template_path139 if deferred_template_file_path.exists():140 deferred_template : str 141 # read template 142 with deferred_template_file_path.open() as f:143 deferred_template = f.read()144 145 # write 146 with deferred_file_path.open("w+") as f:147 f.write(deferred_template.format(148 inline_marco = config.inline_marco149 , math_namespace = config.math_namespace150 ))151 else:152 print("lost deferred template file\n")153 exit()154 # gen util math 155 with (math_dir/ "util_math.h").open("w+") as f:156 # add pragma and forward 157 f.write('''#pragma once\n#include "fuko_math_forward.h"\n''')158 159 # add type include 160 for type in config.vector_type_list:161 f.write(str.format('''#include "Types/{type}.h"\n''', type = type))162 f.write("\n")163 # begin namespace 164 if config.enable_namespace:165 f.write(begin_namespace())166 167 # increment & decrement 168 f.write(gen_math.gen_vector_increment_decrement(config.arithmetic_type_list))169 # arithmetic 170 f.write(gen_math.gen_vector_arithmetic(config.arithmetic_type_list))171 # arithmetic assign 172 f.write(gen_math.gen_vector_arithmetic_assign(config.arithmetic_type_list))173 # swizzle arithmetic 174 f.write(gen_math.gen_swizzle_arithmetic())175 # swizzle arithmetic assign 176 f.write(gen_math.gen_swizzle_arithmetic_assign())177 # end namespace 178 if config.enable_namespace:179 f.write(end_namespace())180 # gen per type math 181 for type in full_type_list :182 math_file_path = math_dir / str.format("{base_type}_math.h", base_type = type)183 with math_file_path.open("w+") as f:184 # add pragma and forward 185 f.write('''#pragma once\n#include <cmath>\n#include <algorithm>\n#include "util_math.h"\n#include "../fuko_math_forward.h"\n''')186 # add type include 187 f.write(str.format('''#include "../Types/{type}.h"\n\n''', type = type))188 # begin namespace 189 if config.enable_namespace:190 f.write(begin_namespace())191 # gen code 192 if type in config.vector_type_list:193 f.write(gen_math.gen_vertor_math(type))194 if type in config.matrix_type_list:195 f.write(gen_math.gen_matrix_math(type))196 # end namespace 197 if config.enable_namespace:198 f.write(end_namespace())199 200 # gen facade file 201 facade_file_template_path = codgen_root_dir / config.facade_file_template_path202 if facade_file_template_path.exists():203 facade_file_template : str 204 # read template 205 with facade_file_template_path.open() as f:206 facade_file_template = f.read()207 # gen includes 208 type_includes = ""209 math_includes = '''#include "Math/util_math.h"\n'''210 for type in full_type_list:211 type_includes += '''#include "Types/{type}.h"\n'''.format(type = type)212 math_includes += '''#include "Math/{type}_math.h"\n'''.format(type = type)213 # write 214 with facade_file_path.open("w+") as f:215 f.write(facade_file_template.format(216 type_includes = type_includes217 , math_includes = math_includes))218 else:219 print("lost facade file template file\n")220 exit()221 # gen testscript 222 test_vector_path = test_root_dir / "test_vector.h"223 test_matrix_path = test_root_dir / "test_matrix.h"224 test_math_path = test_root_dir / "test_math.h"225 test_exec_path = test_root_dir / "main.cpp"226 with test_vector_path.open("w+") as f:227 f.write('''#pragma once228#include "fuko_math.h"\n\n''')229 f.write(gen_test.gen_vector_test(config.vector_type_list))230 with test_matrix_path.open("w+") as f:231 f.write('''#pragma once232#include "fuko_math.h"\n\n''')233 f.write(gen_test.gen_matrix_test(config.matrix_type_list))234 with test_math_path.open("w+") as f:235 f.write('''#pragma once236#include "fuko_math.h"\n\n''')237 f.write(gen_test.gen_math_test(full_type_list))238 with test_exec_path.open("w+") as f:239 f.write(gen_test.gen_exec_test())240 # gen makescript 241 make_script_template_path = codgen_root_dir / config.make_script_template_path242 if make_script_template_path.exists():243 make_script_template : str 244 245 # read template 246 with make_script_template_path.open() as f:247 make_script_template = f.read()248 # write 249 with make_script_path.open("w+") as f:250 f.write(make_script_template)251 else:252 print("lost make script template file\n")...

Full Screen

Full Screen

reference.py

Source:reference.py Github

copy

Full Screen

1from __future__ import annotations2import logging3import typing4from typing import Any, Dict5from silex_client.action.command_base import CommandBase6from silex_client.utils.parameter_types import TaskFileParameterMeta7from silex_maya.utils.thread import execute_in_main_thread8# Forward references9if typing.TYPE_CHECKING:10 from silex_client.action.action_query import ActionQuery11import pathlib12import maya.cmds as cmds13class Reference(CommandBase):14 """15 Reference another Maya scene into the currently opened scene16 """17 parameters = {18 "reference": {19 "label": "Reference file",20 "type": TaskFileParameterMeta(extensions=[".ma", ".mb"]),21 "hide": False,22 },23 "enable_namespace": {"label": "Enable namespace", "type": bool, "value": True},24 "namespace": {"label": "Namespace", "type": str, "value": ""},25 "import": {"type": bool, "value": False, "hide": True},26 }27 async def setup(28 self,29 parameters: Dict[str, Any],30 action_query: ActionQuery,31 logger: logging.Logger,32 ):33 self.command_buffer.parameters[34 "namespace"35 ].hide = not self.command_buffer.parameters["enable_namespace"].value36 @CommandBase.conform_command()37 async def __call__(38 self,39 parameters: Dict[str, Any],40 action_query: ActionQuery,41 logger: logging.Logger,42 ):43 reference: pathlib.Path = parameters["reference"]44 file_name = reference.stem45 args: Dict[str, Any] = {}46 if parameters["enable_namespace"]:47 args["namespace"] = parameters["namespace"] or file_name48 if parameters["import"]:49 args["i"] = True50 args["ra"] = True51 else:52 args["r"] = True...

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