Best Python code snippet using autotest_python
builders.py
Source: builders.py
1import os2from SCons.Script import Environment3def get_android_api(env):4 return env["android_api_level"] if int(env["android_api_level"]) > 28 else "28"5def get_deps_dir(env):6 return env.Dir("#deps").abspath7def get_deps_build_dir(env):8 return get_deps_dir(env) + "/build/build{}.{}.dir".format(env["suffix"], "RelWithDebInfo" if env["debug_symbols"] else "Release")9def get_rtc_source_dir(env):10 return get_deps_dir(env) + "/libdatachannel"11def get_rtc_build_dir(env):12 return get_deps_build_dir(env) + "/libdatachannel"13def get_rtc_include_dir(env):14 return get_rtc_source_dir(env) + "/include"15def get_ssl_source_dir(env):16 return get_deps_dir(env) + "/openssl"17def get_ssl_build_dir(env):18 return get_deps_build_dir(env) + "/openssl"19def get_ssl_install_dir(env):20 return get_ssl_build_dir(env) + "/dest"21def get_ssl_include_dir(env):22 return get_ssl_install_dir(env) + "/include"23def ssl_emitter(target, source, env):24 build_dir = get_ssl_build_dir(env)25 libs = ["libssl.a", "libcrypto.a"]26 install_dir = get_ssl_install_dir(env)27 ssl_include = os.path.join(source[0].abspath, "include")28 return [env.File(build_dir + "/" + l) for l in libs], source29def ssl_action(target, source, env):30 build_dir = get_ssl_build_dir(env)...
build.py
Source: build.py
...69 if tag:70 return 'hg up -r "%s"' % tag71 else:72 return 'hg up'73def get_deps_dir(dependencies):74 deps_dir = dependencies.get('location')75 if not os.path.isabs(deps_dir):76 deps_dir = os.path.abspath(os.path.join(CURDIR, deps_dir))77 if not os.path.exists(deps_dir):78 os.mkdir(deps_dir)79 return deps_dir80def pull_app(package, dependencies):81 type, repo, branch, tag = dependencies.get('project')82 name = os.path.basename(repo).split('.')[0]83 update_cmd = _update_cmd("", type)84 print "updating %s with: %s" % (name, update_cmd)85 _run(update_cmd)86def pull_deps(dependencies):87 """Will make sure dependencies are up-to-date"""88 location = os.getcwd()89 # do we want the latest tags ?90 try:91 deps_dir = get_deps_dir(dependencies)92 for project in dependencies.get('projects', []):93 type, repo, branch, tag = project94 name = os.path.basename(repo).split('.')[0]95 target = os.path.join(deps_dir, name)96 if not os.path.exists(target):97 print "cloning ", name98 if type == 'git':99 _run('git clone %s %s' % (repo, target))100 else:101 _run('hg clone %s %s' % (repo, target))102 os.chdir(target)103 if type == 'git' and branch:104 print "checkout branch %s for %s" % (branch, name)105 _run('git checkout %s' % branch)106 update_cmd = _update_cmd(tag, type)107 print "updating %s with: %s" % (name, update_cmd)108 _run(update_cmd)109 finally:110 os.chdir(location)111def get_package(package):112 return json.load(open(package))113def get_dependencies(dependencies):114 return json.load(open(dependencies))115def pull_release(options, package, dependencies):116 project = dependencies.get('project', [])117 project[3] = options.reltag118 pull_app(package, dependencies)119 # update dependencies now120 dependencies = get_dependencies(options.dependencies)121 pull_deps(dependencies)122def tag_release(package, dependencies):123 rel_tag = "v%(version)s" % package124 if verify_tag(rel_tag):125 raise Exception("repository already tagged for release")126 location = os.getcwd()127 # get the current revision and branch we're working with, update128 # dependencies.json, then tag the repository we're in129 import copy130 old_deps = copy.copy(dependencies)131 try:132 deps_dir = get_deps_dir(dependencies)133 for project in dependencies.get('projects', []):134 type, repo, branch, tag = project135 name = os.path.basename(repo).split('.')[0]136 target = os.path.join(deps_dir, name)137 os.chdir(target)138 # tag the repo139 if type == 'git':140 # lightweight tags for dependency repos141 p = os.popen("git log --pretty=format:'%h' -n 1")142 project[3] = p.read()143 else:144 raise Exception("tagging not implemented for ", type)145 print "tagging %s with %s" % (name, project[3])146 print dependencies...
Check out the latest blogs from LambdaTest on this topic:
Before we discuss Scala testing, let us understand the fundamentals of Scala and how this programming language is a preferred choice for your development requirements.The popularity and usage of Scala are rapidly rising, evident by the ever-increasing open positions for Scala developers.
So, now that the first installment of this two fold article has been published (hence you might have an idea of what Agile Testing is not in my opinion), I’ve started feeling the pressure to explain what Agile Testing actually means to me.
Did you know that according to Statista, the number of smartphone users will reach 18.22 billion by 2025? Let’s face it, digital transformation is skyrocketing and will continue to do so. This swamps the mobile app development market with various options and gives rise to the need for the best mobile app testing tools
As a developer, checking the cross browser compatibility of your CSS properties is of utmost importance when building your website. I have often found myself excited to use a CSS feature only to discover that it’s still not supported on all browsers. Even if it is supported, the feature might be experimental and not work consistently across all browsers. Ask any front-end developer about using a CSS feature whose support is still in the experimental phase in most prominent web browsers. ????
The count of mobile users is on a steep rise. According to the research, by 2025, it is expected to reach 7.49 billion users worldwide. 70% of all US digital media time comes from mobile apps, and to your surprise, the average smartphone owner uses ten apps per day and 30 apps each month.
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!