def test_000_unset(self):
        """Common query with no criteria."""
        # query with no parameters gets all types.
        commons = sorted(self.p.commons())

        q = CommonQuery(self.p)
        q_commons = sorted(q.results())

        self.assertListEqual(commons, q_commons)
Пример #2
0
 def __init__(self, parent, policy, perm_map):
     super(CommonQueryTab, self).__init__(parent)
     self.log = logging.getLogger(__name__)
     self.policy = policy
     self.query = CommonQuery(policy)
     self.setupUi()
    def test_012_perm_indirect_regex(self):
        """Common query with regex permission name patch."""
        q = CommonQuery(self.p, perms="sig.+", perms_regex=True)

        commons = sorted(str(c) for c in q.results())
        self.assertListEqual(["test12a", "test12b"], commons)
    def test_011_perm_indirect_equal(self):
        """Common query with equal permission name patch."""
        q = CommonQuery(self.p, perms=set(["read", "write"]), perms_equal=True)

        commons = sorted(str(c) for c in q.results())
        self.assertListEqual(["test11a"], commons)
    def test_010_perm_indirect_intersect(self):
        """Common query with intersect permission name patch."""
        q = CommonQuery(self.p, perms=set(["null"]), perms_equal=False)

        commons = sorted(str(c) for c in q.results())
        self.assertListEqual(["test10a", "test10b"], commons)
    def test_002_name_regex(self):
        """Common query with regex name match."""
        q = CommonQuery(self.p, name="test2(a|b)", name_regex=True)

        commons = sorted(str(c) for c in q.results())
        self.assertListEqual(["test2a", "test2b"], commons)
    def test_001_name_exact(self):
        """Common query with exact name match."""
        q = CommonQuery(self.p, name="test1")

        commons = sorted(str(c) for c in q.results())
        self.assertListEqual(["test1"], commons)