示例#1
0
文件: mlsrule.py 项目: suezi/setools
    def mock_rangetrans_factory(self, source, target, tclass, default):
        mock_rule = Mock(qpol_range_trans_t)
        mock_rule.rule_type.return_value = "range_transition"
        mock_rule.source_type.return_value = source
        mock_rule.target_type.return_value = target
        mock_rule.object_class.return_value = tclass
        mock_rule.range.return_value = default

        return mls_rule_factory(self.p, mock_rule)
示例#2
0
    def mock_rangetrans_factory(self, source, target, tclass, default):
        mock_rule = Mock(qpol_range_trans_t)
        mock_rule.rule_type.return_value = "range_transition"
        mock_rule.source_type.return_value = source
        mock_rule.target_type.return_value = target
        mock_rule.object_class.return_value = tclass
        mock_rule.range.return_value = default

        return mls_rule_factory(self.p, mock_rule)
示例#3
0
文件: mlsrule.py 项目: suezi/setools
 def test_000_factory(self):
     """RangeTransition factory lookup."""
     with self.assertRaises(TypeError):
         mls_rule_factory(self.p, "INVALID")
示例#4
0
 def test_000_factory(self):
     """RangeTransition factory lookup."""
     with self.assertRaises(TypeError):
         mls_rule_factory(self.p, "INVALID")