當前位置: 首頁>>代碼示例>>Python>>正文


Python CapabilityRule.match方法代碼示例

本文整理匯總了Python中apparmor.rule.capability.CapabilityRule.match方法的典型用法代碼示例。如果您正苦於以下問題:Python CapabilityRule.match方法的具體用法?Python CapabilityRule.match怎麽用?Python CapabilityRule.match使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在apparmor.rule.capability.CapabilityRule的用法示例。


在下文中一共展示了CapabilityRule.match方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _check_invalid_rawrule

# 需要導入模塊: from apparmor.rule.capability import CapabilityRule [as 別名]
# 或者: from apparmor.rule.capability.CapabilityRule import match [as 別名]
    def _check_invalid_rawrule(self, rawrule):
        obj = None
        with self.assertRaises(AppArmorException):
            obj = CapabilityRule(CapabilityRule.parse(rawrule))

        self.assertFalse(CapabilityRule.match(rawrule))
        self.assertIsNone(obj, 'CapbilityRule handed back an object unexpectedly')
開發者ID:crossbuild,項目名稱:apparmor,代碼行數:9,代碼來源:test-capability.py

示例2: _compare_obj_with_rawrule

# 需要導入模塊: from apparmor.rule.capability import CapabilityRule [as 別名]
# 或者: from apparmor.rule.capability.CapabilityRule import match [as 別名]
    def _compare_obj_with_rawrule(self, rawrule, expected):

        obj = CapabilityRule.parse(rawrule)

        self.assertTrue(CapabilityRule.match(rawrule))
        self.assertEqual(rawrule.strip(), obj.raw_rule)

        self._compare_obj(obj, expected)
開發者ID:crossbuild,項目名稱:apparmor,代碼行數:10,代碼來源:test-capability.py

示例3: _check_write_rule

# 需要導入模塊: from apparmor.rule.capability import CapabilityRule [as 別名]
# 或者: from apparmor.rule.capability.CapabilityRule import match [as 別名]
    def _check_write_rule(self, rawrule, cleanrule):
        obj = CapabilityRule.parse(rawrule)
        clean = obj.get_clean()
        raw = obj.get_raw()

        self.assertTrue(CapabilityRule.match(rawrule))
        self.assertEqual(cleanrule.strip(), clean, 'unexpected clean rule')
        self.assertEqual(rawrule.strip(), raw, 'unexpected raw rule')
開發者ID:crossbuild,項目名稱:apparmor,代碼行數:10,代碼來源:test-capability.py

示例4: _is_equal

# 需要導入模塊: from apparmor.rule.capability import CapabilityRule [as 別名]
# 或者: from apparmor.rule.capability.CapabilityRule import match [as 別名]
 def _is_equal(self, obj, rule_to_test, strict):
     self.assertTrue(CapabilityRule.match(rule_to_test))
     return obj.is_equal(CapabilityRule.parse(rule_to_test), strict)
開發者ID:crossbuild,項目名稱:apparmor,代碼行數:5,代碼來源:test-capability.py

示例5: _is_covered_exact

# 需要導入模塊: from apparmor.rule.capability import CapabilityRule [as 別名]
# 或者: from apparmor.rule.capability.CapabilityRule import match [as 別名]
 def _is_covered_exact(self, obj, rule_to_test):
     self.assertTrue(CapabilityRule.match(rule_to_test))
     return obj.is_covered(CapabilityRule.parse(rule_to_test), True, True)
開發者ID:crossbuild,項目名稱:apparmor,代碼行數:5,代碼來源:test-capability.py


注:本文中的apparmor.rule.capability.CapabilityRule.match方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。