Skip to content

Commit

Permalink
Check that 'available' property is False after failed connect attempts
Browse files Browse the repository at this point in the history
  • Loading branch information
JeffLIrion authored Oct 4, 2019
1 parent ec6c279 commit b90beeb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_adb_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def test_connect_no_keys(self):
with self.assertRaises(exceptions.DeviceAuthError):
self.device.connect()

self.assertFalse(self.device.available)

def test_connect_with_key_invalid_response(self):
with patch('adb_shell.auth.sign_pythonrsa.open', open_priv_pub), patch('adb_shell.auth.keygen.open', open_priv_pub):
keygen('tests/adbkey')
Expand All @@ -88,6 +90,8 @@ def test_connect_with_key_invalid_response(self):
with self.assertRaises(exceptions.InvalidResponseError):
self.device.connect([signer])

self.assertFalse(self.device.available)

def test_connect_with_key(self):
with patch('adb_shell.auth.sign_pythonrsa.open', open_priv_pub), patch('adb_shell.auth.keygen.open', open_priv_pub):
keygen('tests/adbkey')
Expand Down

0 comments on commit b90beeb

Please sign in to comment.