Ejemplo n.º 1
0
def test_filter_path_on_suite_negative():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("subsuite")
        class subsuite:
            @lcc.test("test1")
            def baz(self):
                pass

            @lcc.test("test2")
            def test2(self):
                pass

    _test_run_filter([mysuite], RunFilter(paths=["-mysuite.subsuite.*"]), [])
Ejemplo n.º 2
0
def test_filter_path_complete_on_top_suite():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("subsuite")
        class subsuite:
            @lcc.test("test1")
            def test1(self):
                pass

            @lcc.test("test2")
            def test2(self):
                pass

    _test_run_filter([mysuite], RunFilter(paths=["mysuite"]),
                     ["mysuite.subsuite.test1", "mysuite.subsuite.test2"])
Ejemplo n.º 3
0
def test_filter_description_on_test_negative():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("subsuite")
        class subsuite:
            @lcc.test("desc1")
            def baz(self):
                pass

            @lcc.test("desc2")
            def test2(self):
                pass

    _test_run_filter([mysuite], RunFilter(descriptions=[["~desc2"]]),
                     ["mysuite.subsuite.baz"])
Ejemplo n.º 4
0
def test_filter_full_path_on_test():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("subsuite")
        class subsuite:
            @lcc.test("test1")
            def baz(self):
                pass

            @lcc.test("test2")
            def test2(self):
                pass

    _test_run_filter([mysuite], RunFilter(paths=["mysuite.subsuite.baz"]),
                     ["mysuite.subsuite.baz"])
Ejemplo n.º 5
0
def test_filter_description_and():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("subsuite")
        class subsuite:
            @lcc.test("test1")
            def baz(self):
                pass

            @lcc.test("test2")
            def test2(self):
                pass

    _test_run_filter([mysuite],
                     RunFilter(descriptions=[["mysuite"], ["test1"]]),
                     ["mysuite.subsuite.baz"])
Ejemplo n.º 6
0
def test_filter_tag_on_test_negative():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("subsuite")
        class subsuite:
            @lcc.test("test1")
            def baz(self):
                pass

            @lcc.tags("tag1")
            @lcc.test("test2")
            def test2(self):
                pass

    _test_run_filter([mysuite], RunFilter(tags=[["-tag1"]]),
                     ["mysuite.subsuite.baz"])
Ejemplo n.º 7
0
def test_filter_link_on_test_negative_with_name():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("subsuite")
        class subsuite:
            @lcc.test("test1")
            def baz(self):
                pass

            @lcc.link("http://bug.trac.ker/1234", "#1234")
            @lcc.test("test2")
            def test2(self):
                pass

    _test_run_filter([mysuite], RunFilter(links=[["-#1234"]]),
                     ["mysuite.subsuite.baz"])
Ejemplo n.º 8
0
def test_filter_property_on_test():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("subsuite")
        class subsuite:
            @lcc.test("test1")
            def baz(self):
                pass

            @lcc.prop("myprop", "foo")
            @lcc.test("test2")
            def test2(self):
                pass

    _test_run_filter([mysuite], RunFilter(properties=[[("myprop", "foo")]]),
                     ["mysuite.subsuite.test2"])
Ejemplo n.º 9
0
def test_filter_and_or():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("subsuite")
        class subsuite:
            @lcc.test("test1")
            @lcc.tags("foo", "bar")
            def baz(self):
                pass

            @lcc.test("test2")
            @lcc.tags("foo", "baz")
            def test2(self):
                pass

    _test_run_filter([mysuite], RunFilter(tags=[["foo"], ["bar", "baz"]]),
                     ["mysuite.subsuite.baz", "mysuite.subsuite.test2"])
Ejemplo n.º 10
0
def test_filter_description_on_suite():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("desc1")
        class subsuite:
            @lcc.test("baz")
            def baz(self):
                pass

        @lcc.suite("desc2")
        class othersuite:
            @lcc.test("test2")
            def test2(self):
                pass

    _test_run_filter([mysuite], RunFilter(descriptions=[["desc2"]]),
                     ["mysuite.othersuite.test2"])
Ejemplo n.º 11
0
def test_filter_path_on_suite_and_tag_on_test():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("subsuite")
        class subsuite:
            @lcc.test("test1")
            def baz(self):
                pass

            @lcc.tags("tag1")
            @lcc.test("test2")
            def test2(self):
                pass

    _test_run_filter([mysuite],
                     RunFilter(paths=["mysuite.subsuite"], tags=[["tag1"]]),
                     ["mysuite.subsuite.test2"])
Ejemplo n.º 12
0
def test_filter_links_and():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("subsuite")
        class subsuite:
            @lcc.test("test1")
            @lcc.link("http://a.b.c/1234", "#1234")
            @lcc.link("http://a.b.c/1235")
            def baz(self):
                pass

            @lcc.test("test2")
            @lcc.link("http://a.b.c/1234", "#1234")
            def test2(self):
                pass

    _test_run_filter([mysuite], RunFilter(links=[["#1234"], ["*/1235"]]),
                     ["mysuite.subsuite.baz"])
Ejemplo n.º 13
0
def test_filter_properties_and():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("subsuite")
        class subsuite:
            @lcc.test("test1")
            @lcc.prop("foo", "1")
            @lcc.prop("bar", "2")
            def baz(self):
                pass

            @lcc.test("test2")
            @lcc.prop("foo", "1")
            def test2(self):
                pass

    _test_run_filter([mysuite],
                     RunFilter(properties=[[("foo", "1")], [("bar", "2")]]),
                     ["mysuite.subsuite.baz"])
Ejemplo n.º 14
0
def test_filter_link_on_suite():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.link("http://bug.trac.ker/1234", "#1234")
        @lcc.suite("subsuite1")
        class subsuite1:
            @lcc.test("test1")
            def baz(self):
                pass

        @lcc.link("http://bug.trac.ker/1235", "#1235")
        @lcc.suite("subsuite2")
        class subsuite2:
            @lcc.test("test2")
            def test2(self):
                pass

    _test_run_filter([mysuite], RunFilter(links=[["#1235"]]),
                     ["mysuite.subsuite2.test2"])
Ejemplo n.º 15
0
def test_filter_property_on_suite_negative():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.prop("myprop", "foo")
        @lcc.suite("subsuite1")
        class subsuite1:
            @lcc.test("test1")
            def baz(self):
                pass

        @lcc.prop("myprop", "bar")
        @lcc.suite("subsuite2")
        class subsuite2:
            @lcc.test("test2")
            def test2(self):
                pass

    _test_run_filter([mysuite], RunFilter(properties=[[("myprop", "~bar")]]),
                     ["mysuite.subsuite1.baz"])
Ejemplo n.º 16
0
def test_filter_tag_on_suite():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.tags("tag1")
        @lcc.suite("subsuite1")
        class subsuite1:
            @lcc.test("test1")
            def baz(self):
                pass

        @lcc.tags("tag2")
        @lcc.suite("subsuite2")
        class subsuite2:
            @lcc.test("test2")
            def test2(self):
                pass

    _test_run_filter([mysuite], RunFilter(tags=[["tag2"]]),
                     ["mysuite.subsuite2.test2"])
Ejemplo n.º 17
0
def test_filter_path_and_tag_on_suite():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.tags("foo")
        @lcc.suite("subsuite1")
        class subsuite1:
            @lcc.test("test1")
            def test1(self):
                pass

        @lcc.tags("foo")
        @lcc.suite("subsuite2")
        class subsuite2:
            @lcc.test("test2")
            def test2(self):
                pass

    _test_run_filter([mysuite],
                     RunFilter(paths=["mysuite.subsuite1"], tags=[["foo"]]),
                     ["mysuite.subsuite1.test1"])
Ejemplo n.º 18
0
def test_filter_description_on_suite_and_link_on_test():
    @lcc.suite("mysuite")
    class mysuite:
        @lcc.suite("subsuite")
        class subsuite:
            @lcc.test("test1")
            def test1(self):
                pass

        @lcc.suite("Sub suite 2")
        class subsuite2:
            @lcc.link("http://my.bug.trac.ker/1234", "#1234")
            @lcc.test("test2")
            def test2(self):
                pass

            @lcc.test("test3")
            def test3(self):
                pass

    _test_run_filter([mysuite],
                     RunFilter(descriptions=[["Sub suite 2"]],
                               links=[["#1234"]]), ["mysuite.subsuite2.test2"])
Ejemplo n.º 19
0
def test_is_empty_true():
    filt = RunFilter()
    assert filt.is_empty() == True
Ejemplo n.º 20
0
 def do_test(attr, val):
     filt = RunFilter()
     assert hasattr(filt, attr)
     setattr(filt, attr, val)
     assert filt.is_empty() is False