How to use push_file method in autotest

Best Python code snippet using autotest_python

test_gitpuller.py

Source:test_gitpuller.py Github

copy

Full Screen

...15# 5. Make change in puller to file, make change in pusher to same part of file, run puller16# 6. Make untracked file in puller, add file with same name to pusher, run puller17def test_initialize():18 with Remote() as remote, Pusher(remote) as pusher:19 pusher.push_file('README.md', '1')20 cloned_path = os.path.join(tempfile.gettempdir(), str(uuid4()))21 assert not os.path.exists(cloned_path)22 with Puller(remote, cloned_path) as puller:23 assert os.path.exists(os.path.join(puller.path, 'README.md'))24 assert puller.git('name-rev', '--name-only', 'HEAD') == 'master'25 assert puller.git('rev-parse', 'HEAD') == pusher.git('rev-parse', 'HEAD')26def command_line_test_helper(remote_path, branch, pusher_path):27 work_dir = "/".join(os.path.dirname(os.path.abspath(__file__)).split("/")[:-1]) + "/nbgitpuller"28 try:29 cmd = ['python3', 'pull.py', remote_path, branch, pusher_path]30 sp.check_output(31 cmd,32 cwd=work_dir33 ).decode()34 return True35 except Exception:36 return False37def test_command_line_existing_branch():38 branch = "master"39 with Remote() as remote, Pusher(remote) as pusher:40 pusher.push_file('README.md', '1')41 remotepath = "file://%s" % os.path.abspath(remote.path)42 pusherpath = os.path.abspath(pusher.path)43 subprocess_result = command_line_test_helper(remotepath, branch, pusherpath)44 assert subprocess_result45def test_command_line_default_branch():46 branch = ""47 with Remote() as remote, Pusher(remote) as pusher:48 pusher.push_file('README.md', '1')49 remotepath = "file://%s" % os.path.abspath(remote.path)50 pusherpath = os.path.abspath(pusher.path)51 subprocess_result = command_line_test_helper(remotepath, branch, pusherpath)52 assert subprocess_result53def test_command_line_non_existing_branch():54 branch = "wrong"55 with Remote() as remote, Pusher(remote) as pusher:56 pusher.push_file('README.md', '1')57 remotepath = "file://%s" % os.path.abspath(remote.path)58 pusherpath = os.path.abspath(pusher.path)59 subprocess_result = command_line_test_helper(remotepath, branch, pusherpath)60 assert not subprocess_result61def test_branch_exists():62 with Remote() as remote, Pusher(remote) as pusher:63 pusher.push_file('README.md', '1')64 with Puller(remote) as puller:65 puller.pull_all()66 assert not puller.gp.branch_exists("wrong")67 assert puller.gp.branch_exists("master")68def test_exception_branch_exists():69 with Remote() as remote, Pusher(remote) as pusher:70 pusher.push_file('README.md', '1')71 with Puller(remote) as puller:72 orig_url = puller.gp.git_url73 try:74 puller.gp.branch_exists("wrong")75 except Exception as e:76 assert type(e) == ValueError77 puller.gp.git_url = orig_url78def test_resolve_default_branch():79 with Remote() as remote, Pusher(remote) as pusher:80 pusher.push_file('README.md', '1')81 with Puller(remote) as puller:82 assert puller.gp.resolve_default_branch() == "master"83def test_exception_resolve_default_branch():84 with Remote() as remote, Pusher(remote) as pusher:85 pusher.push_file('README.md', '1')86 with Puller(remote) as puller:87 orig_url = puller.gp.git_url88 puller.gp.git_url = ""89 try:90 puller.gp.resolve_default_branch()91 except Exception as e:92 assert type(e) == ValueError93 puller.gp.git_url = orig_url94def test_simple_push_pull():95 """96 Test the 'happy path' push/pull interaction97 1. Push a file to remote, pull (initially) to make sure we get it98 2. Modify file & push to remote, pull to make sure we get update99 3. Add new file to remote, pull to make sure we get it100 4. Delete new file to remote, pull to make sure it is gone101 No modifications are done in the puller repo here, so we do not102 exercise any merging behavior.103 """104 with Remote() as remote, Pusher(remote) as pusher:105 pusher.push_file('README.md', '1')106 with Puller(remote) as puller:107 assert puller.git('rev-parse', 'HEAD') == pusher.git('rev-parse', 'HEAD')108 assert puller.read_file('README.md') == pusher.read_file('README.md') == '1'109 pusher.push_file('README.md', '2')110 puller.pull_all()111 assert puller.git('rev-parse', 'HEAD') == pusher.git('rev-parse', 'HEAD')112 assert puller.read_file('README.md') == pusher.read_file('README.md') == '2'113 pusher.push_file('another-file', '3')114 puller.pull_all()115 assert puller.git('rev-parse', 'HEAD') == pusher.git('rev-parse', 'HEAD')116 assert puller.read_file('another-file') == pusher.read_file('another-file') == '3'117 pusher.git('rm', 'another-file')118 pusher.git('commit', '-m', 'Removing File')119 pusher.git('push', 'origin', 'master')120 puller.pull_all()121 assert puller.git('rev-parse', 'HEAD') == pusher.git('rev-parse', 'HEAD')122 assert not os.path.exists(os.path.join(puller.path, 'another-file'))123def test_git_lock():124 """125 Test the 'happy path', but with stale/unstale git locks126 """127 with Remote() as remote, Pusher(remote) as pusher:128 pusher.push_file('README.md', '1')129 with Puller(remote) as puller:130 pusher.push_file('README.md', '2')131 puller.write_file('.git/index.lock', '')132 exception_raised = False133 try:134 puller.pull_all()135 except Exception:136 exception_raised = True137 assert exception_raised138 new_time = time.time() - 700139 os.utime(os.path.join(puller.path, '.git', 'index.lock'), (new_time, new_time))140 puller.pull_all()141 assert puller.git('rev-parse', 'HEAD') == pusher.git('rev-parse', 'HEAD')142def test_merging_simple():143 """144 Test that when we change local & remote, local changes are preferred145 """146 with Remote() as remote, Pusher(remote) as pusher:147 pusher.push_file('README.md', '1')148 with Puller(remote) as puller:149 assert puller.read_file('README.md') == pusher.read_file('README.md') == '1'150 puller.write_file('README.md', '2')151 pusher.push_file('README.md', '3')152 puller.pull_all()153 # There should be a commit made *before* the pull that has our explicit154 # authorship, to record that it was made by nbgitpuller155 assert puller.git('show', '-s', '--format="%an <%ae>"', 'HEAD^1') == '"nbgitpuller <nbgitpuller@nbgitpuller.link>"'156 assert puller.read_file('README.md') == '2'157 assert pusher.read_file('README.md') == '3'158 # Make sure that further pushes to other files are reflected159 pusher.push_file('another-file', '4')160 puller.pull_all()161 assert puller.read_file('another-file') == pusher.read_file('another-file') == '4'162 # Make sure our merging works across commits163 pusher.push_file('README.md', '5')164 puller.pull_all()165 assert puller.read_file('README.md') == '2'166def test_merging_after_commit():167 """168 Test that merging works even after we make a commit locally169 """170 with Remote() as remote, Pusher(remote) as pusher:171 pusher.push_file('README.md', '1')172 with Puller(remote) as puller:173 assert puller.read_file('README.md') == pusher.read_file('README.md') == '1'174 puller.write_file('README.md', '2')175 puller.git('commit', '-am', 'Local change')176 puller.pull_all()177 assert puller.read_file('README.md') == '2'178 assert pusher.read_file('README.md') == '1'179 pusher.push_file('README.md', '3')180 puller.pull_all()181 # Check if there is a merge commit182 parent_commits = puller.git('show', '-s', '--format="%P"', 'HEAD').strip().split(' ')183 assert(len(parent_commits) == 2)184def test_untracked_puller():185 """186 Test that untracked files in puller are preserved when pulling187 """188 with Remote() as remote, Pusher(remote) as pusher:189 pusher.push_file('README.md', '1')190 with Puller(remote) as puller:191 pusher.push_file('another-file', '2')192 puller.write_file('another-file', '3')193 puller.pull_all()194 assert puller.read_file('another-file') == '2'195 # Find file that was created!196 renamed_file = glob.glob(os.path.join(puller.path, 'another-file_*'))[0]197 assert puller.read_file(os.path.basename(renamed_file)) == '3'198def test_reset_file():199 """200 Test that deleting files locally & pulling restores pristine copy201 """202 with Remote() as remote, Pusher(remote) as pusher:203 pusher.push_file('README.md', '1')204 pusher.push_file('unicode🙂.txt', '2')205 with Puller(remote) as puller:206 os.remove(os.path.join(puller.path, 'README.md'))207 os.remove(os.path.join(puller.path, 'unicode🙂.txt'))208 puller.pull_all()209 assert puller.git('rev-parse', 'HEAD') == pusher.git('rev-parse', 'HEAD')210 assert puller.read_file('README.md') == pusher.read_file('README.md') == '1'211 assert puller.read_file('unicode🙂.txt') == pusher.read_file('unicode🙂.txt') == '2'212def test_reset_file_after_changes():213 """214 Test that we get the latest version of a file if we:215 - change the file locally216 - sync, so the change is preserved217 - delete the file, in order to reset it218 - sync again219 """220 with Remote() as remote, Pusher(remote) as pusher:221 pusher.push_file('README.md', 'original')222 with Puller(remote) as puller:223 puller.write_file('README.md', 'local change')224 pusher.push_file('README.md', 'remote change')225 puller.pull_all()226 # It should keep the local change227 assert puller.read_file('README.md') == 'local change'228 # Delete the local file manually and pull229 os.remove(os.path.join(puller.path, 'README.md'))230 puller.pull_all()231 # It should restore the remote change232 assert puller.read_file('README.md') == 'remote change'233def test_delete_conflicted_file():234 """235 Test that after deleting a file that had a conflict, we can still pull236 """237 with Remote() as remote, Pusher(remote) as pusher:238 pusher.push_file('README.md', 'hello')239 with Puller(remote) as puller:240 # Change a file locally241 puller.write_file('README.md', 'student changed')242 # Sync will keep the local change243 puller.pull_all()244 assert puller.read_file('README.md') == 'student changed'245 # Delete previously changed file246 os.remove(os.path.join(puller.path, 'README.md'))247 # Make a change remotely. We should be able to pull it248 pusher.push_file('new_file.txt', 'hello world')249 puller.pull_all()250def test_delete_remotely_modify_locally():251 """252 Test that we can delete a file upstream, and edit it at the same time locally253 """254 with Remote() as remote, Pusher(remote) as pusher:255 pusher.push_file('README.md', 'new')256 with Puller(remote) as puller:257 # Delete the file remotely258 pusher.git('rm', 'README.md')259 pusher.git('commit', '-m', 'Deleted file')260 # Edit locally261 pusher.push_file('README.md', 'HELLO')262 puller.pull_all()263 assert puller.read_file('README.md') == 'HELLO'264def test_diverged():265 """266 Test deleting a file upstream, and editing it locally. This time we267 commit to create diverged brances.268 """269 with Remote() as remote, Pusher(remote) as pusher:270 pusher.push_file('README.md', 'new')271 with Puller(remote) as puller:272 # Delete the file remotely273 pusher.git('rm', 'README.md')274 pusher.git('commit', '-m', 'Deleted file')275 pusher.git('push', '-u', 'origin', 'master')276 # Edit locally277 puller.write_file('README.md', 'conflict')278 puller.git('add', 'README.md')279 puller.git('commit', '-m', 'Make conflicting change')280 # The local change should be kept281 puller.pull_all()282 assert puller.read_file('README.md') == 'conflict'283def test_diverged_reverse():284 """285 Test deleting a file locally, and editing it upstream. We commit the changes286 to create diverged branches. Like `test_diverged`, but flipped. 287 """288 with Remote() as remote, Pusher(remote) as pusher:289 pusher.push_file('README.md', 'new')290 with Puller(remote) as puller:291 # Delete the file locally292 puller.git('rm', 'README.md')293 puller.git('commit', '-m', 'Deleted file')294 # Edit the file remotely295 pusher.push_file('README.md', 'conflicting change')296 # Pulling should get the latest version of the file297 puller.pull_all()298 assert(puller.read_file('README.md') == 'conflicting change')299def test_diverged_multiple():300 """301 Test deleting a file upstream, and editing it locally. We commit the changes302 to create diverged branches.303 Use two files, so git merge doesn't mention the conflict in the first line.304 puller: Auto-merging AFILE.txt305 puller: CONFLICT (modify/delete): BFILE.txt deleted in origin/master and modified in HEAD. Version HEAD of BFILE.txt left in tree.306 puller: Automatic merge failed; fix conflicts and then commit the result.307 """308 with Remote() as remote, Pusher(remote) as pusher:309 pusher.push_file('AFILE.txt', 'new')310 pusher.push_file('BFILE.txt', 'new')311 with Puller(remote) as puller:312 # Remote changes - BFILE.txt deleted 313 pusher.write_file('AFILE.txt', 'changed remotely')314 pusher.git('add', 'AFILE.txt')315 pusher.git('rm', 'BFILE.txt')316 pusher.git('commit', '-m', 'Remote changes')317 pusher.git('push', '-u', 'origin', 'master')318 319 # Local changes - BFILE.txt edited320 puller.write_file('AFILE.txt', 'edited')321 puller.write_file('BFILE.txt', 'edited')322 puller.git('commit', '-am', 'Make conflicting change')323 puller.pull_all()324 assert puller.read_file('AFILE.txt') == 'edited'325 assert puller.read_file('BFILE.txt') == 'edited'326def test_delete_locally_and_remotely():327 """328 Test that sync works after deleting a file locally and remotely329 """330 with Remote() as remote, Pusher(remote) as pusher:331 pusher.push_file('README.md', '1')332 with Puller(remote) as puller:333 assert puller.read_file('README.md') == pusher.read_file('README.md') == '1'334 # Delete locally (without git rm)335 os.remove(os.path.join(puller.path, 'README.md'))336 # Delete remotely337 pusher.git('rm', 'README.md')338 # Create another change to pull339 pusher.push_file('another_file.txt', '2')340 puller.pull_all()341 assert not os.path.exists(os.path.join(puller.path, 'README.md'))342 assert puller.read_file('another_file.txt') == '2'343def test_sync_with_staged_changes():344 """345 Test that we can sync even if there are staged changess346 """347 with Remote() as remote, Pusher(remote) as pusher:348 pusher.push_file('README.md', '1')349 with Puller(remote) as puller:350 assert puller.read_file('README.md') == pusher.read_file('README.md') == '1'351 # Change a file locally and remotely352 puller.write_file('README.md', 'student changed')353 pusher.push_file('README.md', 'teacher changed')354 # Stage the local change, but do not commit355 puller.git('add', 'README.md')356 # Try to sync357 puller.pull_all()358@pytest.fixture(scope='module')359def long_remote():360 with Remote() as remote, Pusher(remote) as pusher:361 for i in range(0, 10):362 pusher.git('commit', '--allow-empty', '-m', "Empty message %d" % i)363 pusher.git('push', 'origin', 'master')364 yield remote365@pytest.fixture(scope="function")366def clean_environment():367 """368 Save and restore the state of named VARIABLES before, during, and369 after tests.370 """371 VARIABLES = ['NBGITPULLER_DEPTH']372 backups = {}373 for var in VARIABLES:374 backups[var] = os.environ.get(var)375 if backups[var]:376 del os.environ[var]377 yield378 for var in backups:379 if backups[var]:380 os.environ[var] = backups[var]381 elif os.environ.get(var):382 del os.environ[var]383def count_loglines(repository):384 return len(repository.git('log', '--oneline').split("\n"))385def test_unshallow_clone(long_remote, clean_environment):386 """387 Sanity-test that clones with 10 commits have 10 log entries388 """389 os.environ['NBGITPULLER_DEPTH'] = "0"390 with Puller(long_remote) as puller:391 assert count_loglines(puller) == 10392def test_shallow_clone(long_remote, clean_environment):393 """394 Test that shallow clones only have a portion of the git history395 """396 with Puller(long_remote, depth=4) as puller:397 assert count_loglines(puller) == 4398def test_shallow_clone_config(long_remote, clean_environment):399 """400 Test that shallow clones can be configured via parent Configurables401 """402 class TempConfig(Configurable):403 def __init__(self):404 super(TempConfig)405 self.config['GitPuller']['depth'] = 5406 with Puller(long_remote, parent=TempConfig()) as puller:407 assert count_loglines(puller) == 5408def test_environment_shallow_clone(long_remote, clean_environment):409 """410 Test that shallow clones respect the NBGITPULLER_DEPTH environment variable411 by default412 """413 os.environ['NBGITPULLER_DEPTH'] = "2"414 with Puller(long_remote) as puller:415 assert count_loglines(puller) == 2416def test_explicit_unshallow(long_remote, clean_environment):417 """418 Test that we can disable environment-specified shallow clones419 """420 os.environ['NBGITPULLER_DEPTH'] = "2"421 with Puller(long_remote, depth=0) as puller:422 assert count_loglines(puller) == 10423def test_pull_on_shallow_clone(long_remote, clean_environment):424 """425 Test that we can perform a pull on a shallow clone426 """427 with Puller(long_remote, depth=0) as shallow_puller:428 with Pusher(long_remote) as pusher:429 pusher.push_file('test_file', 'test')430 orig_head = shallow_puller.git('rev-parse', 'HEAD')431 shallow_puller.pull_all()432 new_head = shallow_puller.git('rev-parse', 'HEAD')433 upstream_head = long_remote.git('rev-parse', 'HEAD')434 assert orig_head != new_head435 assert new_head == upstream_head...

Full Screen

Full Screen

run_tests.py

Source:run_tests.py Github

copy

Full Screen

...81 self.assertEqual(40, len(sha))82 @mock.patch("commitment.GitHubClient.get_file_bytes", mock_get_file_return_foo)83 def test_push_file_remote_file_equals_local_file(self):84 g = GitHubClient(self.creds)85 res = g.push_file("foo", "foo/bar.baz", "my commit message")86 # If the local content is the same as87 # the remote content push_file() should do nothing88 self.assertIsNone(res)89 @mock.patch("commitment.GitHubClient.get_file_bytes", mock_get_file_raise_404)90 @mock.patch("requests.request", mock_request_success)91 def test_push_file_no_remote_file(self):92 g = GitHubClient(self.creds)93 res = g.push_file("foo", "foo/bar.baz", "my commit message")94 # If no remote content exists95 # push_file() should push the local content96 self.assertEqual(201, res)97 @mock.patch("commitment.GitHubClient.get_file_bytes", mock_get_file_return_foo)98 @mock.patch("requests.request", mock_request_success)99 def test_push_file_remote_file_not_equal_local_file(self):100 g = GitHubClient(self.creds)101 res = g.push_file("bar", "foo/bar.baz", "my commit message")102 # If remote content != local content103 # push_file() should push the local content104 self.assertEqual(201, res)105 @mock.patch("commitment.GitHubClient.get_file_bytes", mock_get_file_raise_500)106 def test_push_file_remote_file_raises_500(self):107 g = GitHubClient(self.creds)108 # if getting remote content raises109 # push_file() should re-raise110 with self.assertRaises(requests.exceptions.HTTPError):111 g.push_file("foo", "foo/bar.baz", "my commit message")112 @mock.patch("commitment.GitHubClient.get_file_bytes", mock_get_file_raise_404)113 @mock.patch("requests.request", mock_request_failure)114 @mock.patch("requests.Response.json", mock_json)115 def test_push_file_put_failure(self):116 g = GitHubClient(self.creds)117 # if put() raises118 # push_file() should re-raise119 with self.assertRaises(requests.exceptions.HTTPError):120 g.push_file("foo", "foo/bar.baz", "my commit message")121 @mock.patch("requests.get", mock_request_success)122 @mock.patch("requests.Response.json", lambda x: {"object": {"sha": "foo"}})123 def test_get_head_sha_success(self):124 g = GitHubClient(self.creds)125 self.assertEqual("foo", g._get_head_sha("master"))126 @mock.patch("requests.get", mock_request_failure)127 def test_get_head_sha_failure(self):128 g = GitHubClient(self.creds)129 with self.assertRaises(requests.exceptions.HTTPError):130 g._get_head_sha("master")131 @mock.patch("requests.request", mock_request_success)132 def test_open_pull_request_success(self):133 g = GitHubClient(self.creds)134 self.assertEqual(201, g.open_pull_request("foo", "bar", "baz"))...

Full Screen

Full Screen

asynccontroller.py

Source:asynccontroller.py Github

copy

Full Screen

1"""2Controller that was previously used to run the processing async3That was a dumb idea..4"""5import json6import magic7from app import db8from app.models.application import MobileFile, MobileFileFinding, MobileApplication9def run_on_zip_queue(zip_data, app_id):10 """11 Process the zip file and findings12 Was running async but broke stuff so back to the default one :)13 :param zip_data:14 :param app_id:15 :return:16 """17 seen_findings = []18 for file in zip_data.namelist():19 if is_blacklisted(file):20 continue21 with zip_data.open(file, "r") as get_file:22 fh_data = get_file.read()23 push_file = MobileFile()24 push_file.name = file25 push_file.data = fh_data26 try:27 push_file.mime = magic.from_buffer(fh_data, mime=True)28 except magic.MagicException:29 push_file.mime = "unknown/x-unknown"30 push_file.application_id = app_id31 db.session.add(push_file)32 if file == "meta.json":33 parsed = json.loads(fh_data)34 current_app: MobileApplication = MobileApplication.query.filter(35 MobileApplication.checksum == app_id36 ).first()37 current_app.version_name = parsed.get("common").get("version_name")38 current_app.version_code = parsed.get("common").get("version_code")39 current_app.icon = parsed.get("common").get("icon_data")40 db.session.commit()41 db.session.commit()42 with zip_data.open("vulns.json", "r") as read_vulns:43 vulns = json.load(read_vulns)44 for finding in vulns:45 if finding.get("search_type") == "once" and finding.get("key") in seen_findings:46 continue47 filename = finding.get("filename")48 filename = filename.replace("\\\\", "\\").replace("\\", "/")49 filename = filename.replace(f"sources/{app_id}/", "")50 if is_blacklisted(filename):51 continue52 try:53 mdf = MobileFileFinding()54 mdf.name = finding.get("key")55 mdf.text = finding.get("text")56 mdf.description = finding.get("description")57 mdf.application_id = app_id58 mdf.filename = filename59 mdf.file_line = finding.get("line_number")60 mdf.highlight = finding.get("highlight")61 mdf.severity = finding.get("severity")62 mdf.file_id = push_file.id63 mdf.mobile_asvs = finding.get("mobile_asvs")64 db.session.add(mdf)65 db.session.commit()66 except Exception as get_exception:67 print(f"Error adding finding: {str(get_exception)}")68 return True69def is_blacklisted(filename):70 """71 Block useless files from getting stored72 Mostly images73 :param filename:74 :return:75 """76 allowed_resources = [77 ".json", ".js", ".properties", ".sh",78 ".so", "AndroidManifest.xml", ".bin",79 ".html", "config.xml", "network_security_config.xml",80 "values.xml", "values/strings.xml"81 ]82 # a bit weird that I blocked any directory containing "/android/83 blocked_sources = [84 "com/google/android",85 "/androidx/",86 "/R.java"87 ]88 if filename.startswith("resources/"):89 for allowed in allowed_resources:90 if filename.endswith(allowed):91 return False92 return True93 if filename.startswith("sources/"):94 for blocked in blocked_sources:95 if blocked in filename:96 return True...

Full Screen

Full Screen

fill_screens.py

Source:fill_screens.py Github

copy

Full Screen

...30 + " " + fn);31 if rv != 0:32 print "adb pull failed"33 sys.exit(1)34def push_file(fn):35 print "push_file: " + fn36 rv = os.system("adb push"37 + " " + fn38 + " /data/data/com.android.launcher/databases/launcher.db")39 if rv != 0:40 print "adb push failed"41 sys.exit(1)42def process_file(fn):43 print "process_file: " + fn44 conn = sqlite3.connect(fn)45 c = conn.cursor()46 c.execute("DELETE FROM favorites")47 intentFormat = "#Intent;action=android.intent.action.MAIN;category=android.intent.category.LAUNCHER;launchFlags=0x10200000;component=%s;end"48 id = 0;49 for s in range(SCREENS):50 for x in range(ROWS):51 for y in range(COLUMNS):52 id += 153 insert = "INSERT into favorites (_id, title, intent, container, screen, cellX, cellY, spanX, spanY, itemType, appWidgetId, iconType) VALUES (%d, '%s', '%s', %d, %d, %d, %d, %d, %d, %d, %d, %d)"54 insert = insert % (id, "title", "", -100, s, x, y, 1, 1, 2, -1, 0)55 c.execute(insert)56 folder_id = id57 for z in range(15):58 id += 159 intent = intentFormat % (APPLICATION_COMPONENTS[id % len(APPLICATION_COMPONENTS)])60 insert = "INSERT into favorites (_id, title, intent, container, screen, cellX, cellY, spanX, spanY, itemType, appWidgetId, iconType) VALUES (%d, '%s', '%s', %d, %d, %d, %d, %d, %d, %d, %d, %d)"61 insert = insert % (id, "title", intent, folder_id, 0, 0, 0, 1, 1, 0, -1, 0)62 c.execute(insert)63 conn.commit()64 c.close()65def main(argv):66 if len(argv) == 1:67 make_dir()68 pull_file(AUTO_FILE)69 process_file(AUTO_FILE)70 push_file(AUTO_FILE)71 else:72 usage()73if __name__=="__main__":...

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