diff options
author | Sachin Sagadevan <148814276+ssachinsunder@users.noreply.github.com> | 2023-10-31 00:10:18 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-30 22:10:18 -0700 |
commit | 8ad26db66f37450a9abe87f8cf47b2b241c3a1f5 (patch) | |
tree | 026d00332c2f2d270d8bc2eeb86e07ec4a09455e /tests | |
parent | ebdec3a739616cf48b6d60624b68801d0bbf4718 (diff) | |
download | mobly-8ad26db66f37450a9abe87f8cf47b2b241c3a1f5.tar.gz |
Adding ability to run adb reverse via mobly AdbProxy, fixes #900 (#903)
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/mobly/controllers/android_device_lib/adb_test.py | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/mobly/controllers/android_device_lib/adb_test.py b/tests/mobly/controllers/android_device_lib/adb_test.py index 4b26b92..65c7eb5 100755 --- a/tests/mobly/controllers/android_device_lib/adb_test.py +++ b/tests/mobly/controllers/android_device_lib/adb_test.py @@ -702,7 +702,23 @@ class AdbTest(unittest.TestCase): def test_forward(self): with mock.patch.object(adb.AdbProxy, '_exec_cmd') as mock_exec_cmd: - adb.AdbProxy().forward(MOCK_SHELL_COMMAND) + adb.AdbProxy().forward(['tcp:12345', 'tcp:98765']) + mock_exec_cmd.assert_called_with( + ['adb', 'forward', 'tcp:12345', 'tcp:98765'], + shell=False, + timeout=None, + stderr=None, + ) + + def test_reverse(self): + with mock.patch.object(adb.AdbProxy, '_exec_cmd') as mock_exec_cmd: + adb.AdbProxy().reverse(['tcp:12345', 'tcp:98765']) + mock_exec_cmd.assert_called_with( + ['adb', 'reverse', 'tcp:12345', 'tcp:98765'], + shell=False, + timeout=None, + stderr=None, + ) def test_instrument_without_parameters(self): """Verifies the AndroidDevice object's instrument command is correct in |