Best Python code snippet using Airtest
test_adb.py
Source:test_adb.py
...91 try_remove(imgname)92 self.adb.pull(tmpimgpath, ".")93 self.assertTrue(os.path.exists(imgname))94 try_remove(imgname)95 def test_get_forwards(self):96 self.adb.remove_forward()97 self.adb.forward(local='tcp:6100', remote="tcp:7100")98 forwards = self.adb.get_forwards()99 self.assertIsInstance(forwards, GeneratorType)100 forwards = list(forwards)101 self.assertEqual(len(forwards), 1)102 sn, local, remote = forwards[0]103 self.assertEqual(sn, self.adb.serialno)104 self.assertEqual(local, 'tcp:6100')105 self.assertEqual(remote, 'tcp:7100')106 def test_remove_forward(self):107 self.adb.remove_forward()108 self.assertEqual(len(list(self.adb.get_forwards())), 0)109 # set a remote and remove it...
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!!