Example #1
0
    def test_000_unset(self):
        """MLS category query with no criteria."""
        # query with no parameters gets all categories.
        allcats = sorted(str(c) for c in self.p.categories())

        q = CategoryQuery(self.p)
        qcats = sorted(str(c) for c in q.results())

        self.assertListEqual(allcats, qcats)
Example #2
0
    def test_000_unset(self):
        """MLS category query with no criteria."""
        # query with no parameters gets all categories.
        allcats = sorted(str(c) for c in self.p.categories())

        q = CategoryQuery(self.p)
        qcats = sorted(str(c) for c in q.results())

        self.assertListEqual(allcats, qcats)
Example #3
0
 def __init__(self, parent, policy, perm_map):
     super(CategoryQueryTab, self).__init__(parent)
     self.log = logging.getLogger(__name__)
     self.policy = policy
     self.query = CategoryQuery(policy)
     self.setupUi()
Example #4
0
    def test_011_alias_regex(self):
        """MLS category query with regex alias match."""
        q = CategoryQuery(self.p, alias="test11(a|b)", alias_regex=True)

        cats = sorted(str(t) for t in q.results())
        self.assertListEqual(["test11c1", "test11c2"], cats)
Example #5
0
    def test_010_alias_exact(self):
        """MLS category query with exact alias match."""
        q = CategoryQuery(self.p, alias="test10a")

        cats = sorted(str(t) for t in q.results())
        self.assertListEqual(["test10c1"], cats)
Example #6
0
    def test_002_name_regex(self):
        """MLS category query with regex name match."""
        q = CategoryQuery(self.p, name="test2(a|b)", name_regex=True)

        cats = sorted(str(c) for c in q.results())
        self.assertListEqual(["test2a", "test2b"], cats)
Example #7
0
    def test_001_name_exact(self):
        """MLS category query with exact name match."""
        q = CategoryQuery(self.p, name="test1")

        cats = sorted(str(c) for c in q.results())
        self.assertListEqual(["test1"], cats)
Example #8
0
    def test_011_alias_regex(self):
        """MLS category query with regex alias match."""
        q = CategoryQuery(self.p, alias="test11(a|b)", alias_regex=True)

        cats = sorted(str(t) for t in q.results())
        self.assertListEqual(["test11c1", "test11c2"], cats)
Example #9
0
    def test_010_alias_exact(self):
        """MLS category query with exact alias match."""
        q = CategoryQuery(self.p, alias="test10a")

        cats = sorted(str(t) for t in q.results())
        self.assertListEqual(["test10c1"], cats)
Example #10
0
    def test_002_name_regex(self):
        """MLS category query with regex name match."""
        q = CategoryQuery(self.p, name="test2(a|b)", name_regex=True)

        cats = sorted(str(c) for c in q.results())
        self.assertListEqual(["test2a", "test2b"], cats)
Example #11
0
    def test_001_name_exact(self):
        """MLS category query with exact name match."""
        q = CategoryQuery(self.p, name="test1")

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