本文整理匯總了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)