本文整理汇总了Python中privacyidea.lib.policy.PolicyClass._search_value方法的典型用法代码示例。如果您正苦于以下问题:Python PolicyClass._search_value方法的具体用法?Python PolicyClass._search_value怎么用?Python PolicyClass._search_value使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类privacyidea.lib.policy.PolicyClass
的用法示例。
在下文中一共展示了PolicyClass._search_value方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_20_search_values
# 需要导入模块: from privacyidea.lib.policy import PolicyClass [as 别名]
# 或者: from privacyidea.lib.policy.PolicyClass import _search_value [as 别名]
def test_20_search_values(self):
P = PolicyClass()
found, excluded = P._search_value(["v1", "v2"], "v1")
self.assertTrue(found)
found, excluded = P._search_value(["v1", "v2"], "v3")
self.assertFalse(found)
found, excluded = P._search_value(["v1", "*"], "v3")
self.assertTrue(found)
found, excluded = P._search_value(["v1", "-v2"], "v2")
self.assertTrue(excluded)
found, excluded = P._search_value(["v1", "v.*"], "v3")
self.assertTrue(found)
self.assertFalse(excluded)
found, excluded = P._search_value(["v1", "r.*"], "v13")
self.assertFalse(found)
self.assertFalse(excluded)