コード例 #1
0
 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))
コード例 #2
0
 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))
コード例 #3
0
 def test_unix_close2(self):
     self.test_unix_disconnect2()
     uobject = MagicMock(spec=UnixHost)
     self.assertTrue(UnixHost.close(uobject))