本文整理汇总了Python中host.hypervisor.esx.vim_client.VimClient.host_system方法的典型用法代码示例。如果您正苦于以下问题:Python VimClient.host_system方法的具体用法?Python VimClient.host_system怎么用?Python VimClient.host_system使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类host.hypervisor.esx.vim_client.VimClient
的用法示例。
在下文中一共展示了VimClient.host_system方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_vim_client_errback
# 需要导入模块: from host.hypervisor.esx.vim_client import VimClient [as 别名]
# 或者: from host.hypervisor.esx.vim_client.VimClient import host_system [as 别名]
def test_vim_client_errback(self, connect_mock, host_mock):
callback = MagicMock()
vim_client = VimClient(auto_sync=False, errback=callback)
vim_client.connect_userpwd("esx.local", "root", "password")
host_mock.side_effect = vim.fault.NotAuthenticated
vim_client.host_system()
callback.assert_called_once()
host_mock.side_effect = vim.fault.HostConnectFault
vim_client.host_system()
assert_that(callback.call_count, is_(2))
host_mock.side_effect = vim.fault.InvalidLogin
vim_client.host_system()
assert_that(callback.call_count, is_(3))
host_mock.side_effect = AcquireCredentialsException
vim_client.host_system()
assert_that(callback.call_count, is_(4))
示例2: test_clone_ticket
# 需要导入模块: from host.hypervisor.esx.vim_client import VimClient [as 别名]
# 或者: from host.hypervisor.esx.vim_client.VimClient import host_system [as 别名]
def test_clone_ticket(self):
ticket = self.vim_client.get_vim_ticket()
vim_client2 = VimClient()
vim_client2.connect_ticket(self.host, ticket)
vim_client2.host_system()