def test_unix_disconnect(self): uobject = MagicMock(spec=UnixHost) uobject.connect_mode = 'ssh' uobject.handle = MagicMock() uobject.log_handle = MagicMock() uobject.close_obj = MagicMock() self.assertTrue(UnixHost.close(uobject))
def test_unix_close_exception(self): uobject = MagicMock(spec=UnixHost) uobject.disconnect = MagicMock() uobject.disconnect.side_effect = Exception self.assertRaises(Exception, lambda: UnixHost.close(uobject))
def test_unix_close2(self): self.test_unix_disconnect2() uobject = MagicMock(spec=UnixHost) self.assertTrue(UnixHost.close(uobject))