mirror of
https://github.com/lowobservable/oec.git
synced 2026-04-16 08:26:25 +00:00
Disconnect session on ConnectionResetError
This commit is contained in:
@@ -75,6 +75,16 @@ class SessionHandleHostTestCase(unittest.TestCase):
|
||||
|
||||
self.telnet.close.assert_called()
|
||||
|
||||
def test_connection_reset(self):
|
||||
# Arrange
|
||||
self.session.emulator.update = Mock(side_effect=ConnectionResetError)
|
||||
|
||||
# Act and assert
|
||||
with self.assertRaises(SessionDisconnectedError):
|
||||
self.session.handle_host()
|
||||
|
||||
self.telnet.close.assert_called()
|
||||
|
||||
def test_keyboard_locked(self):
|
||||
# Arrange
|
||||
self.session.emulator.update = Mock(return_value=True)
|
||||
|
||||
Reference in New Issue
Block a user