Skip to content

Commit

Permalink
Clean up tests in test_adb_manager.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffLIrion committed Dec 19, 2019
1 parent aba9987 commit 1654cb1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions tests/test_adb_manager.py
Expand Up @@ -144,10 +144,10 @@ def test_adb_shell_fail(self):
self.assertTrue(self.adb.connect())
with patch.object(self.adb, '_adb_lock', LockedLock()):
with self.assertRaises(LockNotAcquiredException):
self.assertIsNone(self.adb.shell("TEST"))
self.adb.shell("TEST")

with self.assertRaises(LockNotAcquiredException):
self.assertIsNone(self.adb.shell("TEST2"))
self.adb.shell("TEST2")

def test_adb_shell_success(self):
"""Test when an ADB shell command is successfully sent.
Expand Down Expand Up @@ -182,7 +182,8 @@ def test_adb_shell_lock_not_acquired_not_released(self):
with patch('{}.LockedLock.release'.format(__name__)) as release:
with self.assertRaises(LockNotAcquiredException):
self.adb.shell("TEST")
release.assert_not_called()

release.assert_not_called()

def test_adb_push_fail(self):
"""Test when an ADB push command is not executed because the device is unavailable.
Expand Down Expand Up @@ -337,6 +338,7 @@ class TestADBPythonClose(unittest.TestCase):

def test_close(self):
"""Test the `ADBPython.close` method.
"""
with patchers.PATCH_ADB_DEVICE_TCP, patchers.patch_connect(True)[self.PATCH_KEY]:
self.adb = ADBPython('HOST', 5555)
Expand Down

0 comments on commit 1654cb1

Please sign in to comment.