本文整理汇总了Python中bootstrap.Bootstrap.getUtime方法的典型用法代码示例。如果您正苦于以下问题:Python Bootstrap.getUtime方法的具体用法?Python Bootstrap.getUtime怎么用?Python Bootstrap.getUtime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bootstrap.Bootstrap
的用法示例。
在下文中一共展示了Bootstrap.getUtime方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_getRunSetupWithPasswordCommand
# 需要导入模块: from bootstrap import Bootstrap [as 别名]
# 或者: from bootstrap.Bootstrap import getUtime [as 别名]
def test_getRunSetupWithPasswordCommand(self, environ_mock):
shared_state = SharedState("root", "sshkey_file", "scriptDir", "bootdir",
"setupAgentFile", "ambariServer", "centos6",
None, "8440", "root")
environ_mock.__getitem__.return_value = "TEST_PASSPHRASE"
bootstrap_obj = Bootstrap("hostname", shared_state)
utime = 1234
bootstrap_obj.getUtime = MagicMock(return_value=utime)
ret = bootstrap_obj.getRunSetupWithPasswordCommand("hostname")
expected = "sudo -S python /var/lib/ambari-agent/data/tmp/setupAgent{0}.py hostname TEST_PASSPHRASE " \
"ambariServer root 8440 < /var/lib/ambari-agent/data/tmp/host_pass{0}".format(utime)
self.assertEquals(ret, expected)
示例2: test_generateRandomFileName
# 需要导入模块: from bootstrap import Bootstrap [as 别名]
# 或者: from bootstrap.Bootstrap import getUtime [as 别名]
def test_generateRandomFileName(self):
shared_state = SharedState("root", "sshkey_file", "scriptDir", "bootdir",
"setupAgentFile", "ambariServer", "centos6",
None, "8440", "root")
bootstrap_obj = Bootstrap("hostname", shared_state)
self.assertTrue(bootstrap_obj.generateRandomFileName(None) == bootstrap_obj.getUtime())