示例#1
0
 def test_disconnect_call(self):
     mock_disconnect = MagicMock()
     with patch('salt.utils.vmware.disconnect', mock_disconnect):
         vsphere.disconnect(mock_si)
     mock_disconnect.assert_called_once_with(mock_si)
示例#2
0
 def test_output(self):
     res = vsphere.disconnect(mock_si)
     self.assertEqual(res, True)
示例#3
0
 def test_supported_proxes(self):
     supported_proxies = ['esxi']
     for proxy_type in supported_proxies:
         with patch('salt.modules.vsphere.get_proxy_type',
                    MagicMock(return_value=proxy_type)):
             vsphere.disconnect(mock_si)