本文整理汇总了Python中charmhelpers.contrib.hardening.audits.BaseAudit方法的典型用法代码示例。如果您正苦于以下问题:Python audits.BaseAudit方法的具体用法?Python audits.BaseAudit怎么用?Python audits.BaseAudit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类charmhelpers.contrib.hardening.audits
的用法示例。
在下文中一共展示了audits.BaseAudit方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_take_action_default
# 需要导入模块: from charmhelpers.contrib.hardening import audits [as 别名]
# 或者: from charmhelpers.contrib.hardening.audits import BaseAudit [as 别名]
def test_take_action_default(self):
check = BaseAudit()
take_action = check._take_action()
self.assertTrue(take_action)
示例2: test_take_action_unless_true
# 需要导入模块: from charmhelpers.contrib.hardening import audits [as 别名]
# 或者: from charmhelpers.contrib.hardening.audits import BaseAudit [as 别名]
def test_take_action_unless_true(self):
check = BaseAudit(unless=True)
take_action = check._take_action()
self.assertFalse(take_action)
示例3: test_take_action_unless_false
# 需要导入模块: from charmhelpers.contrib.hardening import audits [as 别名]
# 或者: from charmhelpers.contrib.hardening.audits import BaseAudit [as 别名]
def test_take_action_unless_false(self):
check = BaseAudit(unless=False)
take_action = check._take_action()
self.assertTrue(take_action)
示例4: test_take_action_unless_callback_false
# 需要导入模块: from charmhelpers.contrib.hardening import audits [as 别名]
# 或者: from charmhelpers.contrib.hardening.audits import BaseAudit [as 别名]
def test_take_action_unless_callback_false(self):
def callback():
return False
check = BaseAudit(unless=callback)
take_action = check._take_action()
self.assertTrue(take_action)
示例5: test_take_action_unless_callback_true
# 需要导入模块: from charmhelpers.contrib.hardening import audits [as 别名]
# 或者: from charmhelpers.contrib.hardening.audits import BaseAudit [as 别名]
def test_take_action_unless_callback_true(self):
def callback():
return True
check = BaseAudit(unless=callback)
take_action = check._take_action()
self.assertFalse(take_action)