Beispiel #1
0
 def test_run_command_exception_gaierror(self):
     """Testing socket.gaierror in run_command."""
     self.connection._telnet = mock.Mock()
     self.connection._telnet.write = mock.Mock()
     self.connection._telnet.write.side_effect = socket.gaierror('except')
     self.connection.run_command('test')
     self.assertFalse(self.connection._connected)
Beispiel #2
0
 def test_run_command_exception_gaierror(self):
     """Testing socket.gaierror in run_command."""
     self.connection._telnet = mock.Mock()
     self.connection._telnet.write = mock.Mock()
     self.connection._telnet.write.side_effect = socket.gaierror('except')
     self.connection.run_command('test')
     self.assertFalse(self.connection._connected)