Exemplo n.º 1
0
    def test_markes_test_item_by_test_method_decorator(self):
        class Test(unittest.TestCase):
            @tag('include')
            def test_method(self):
                pass

        test_item = Test('test_method')

        get_tags(test_item) | should | be_equal_to(set(['include']))
Exemplo n.º 2
0
    def test_markes_test_item_by_test_method_decorator(self):
        class Test(unittest.TestCase):

            @tag('include')
            def test_method(self):
                pass
        test_item = Test('test_method')

        get_tags(test_item) |should| be_equal_to(set(['include']))
Exemplo n.º 3
0
    def test_combines_tags_from_method_and_class(self):
        @tag('class')
        class Test(unittest.TestCase):

            @tag('method')
            def test_method(self):
                pass
        test_item = Test('test_method')

        get_tags(test_item) |should| be_equal_to(set(['class', 'method']))
Exemplo n.º 4
0
    def test_combines_tags_from_method_and_class(self):
        @tag('class')
        class Test(unittest.TestCase):
            @tag('method')
            def test_method(self):
                pass

        test_item = Test('test_method')

        get_tags(test_item) | should | be_equal_to(set(['class', 'method']))
Exemplo n.º 5
0
    def test_combines_tags_from_class_and_mixin(self):
        @tag('mixin')
        class Mixin(object):
            pass

        @tag('class')
        class Test(Mixin, unittest.TestCase):

            def test_method(self):
                pass
        test_item = Test('test_method')

        get_tags(test_item) |should| be_equal_to(set(['class', 'mixin']))
Exemplo n.º 6
0
    def test_combines_tags_from_method_and_superclass(self):
        @tag('super')
        class Super(unittest.TestCase):
            pass

        class Test(Super):

            @tag('method')
            def test_method(self):
                pass
        test_item = Test('test_method')

        get_tags(test_item) |should| be_equal_to(set(['method', 'super']))
Exemplo n.º 7
0
    def test_combines_tags_from_class_and_mixin(self):
        @tag('mixin')
        class Mixin(object):
            pass

        @tag('class')
        class Test(Mixin, unittest.TestCase):
            def test_method(self):
                pass

        test_item = Test('test_method')

        get_tags(test_item) | should | be_equal_to(set(['class', 'mixin']))
Exemplo n.º 8
0
    def test_combines_tags_from_method_and_superclass(self):
        @tag('super')
        class Super(unittest.TestCase):
            pass

        class Test(Super):
            @tag('method')
            def test_method(self):
                pass

        test_item = Test('test_method')

        get_tags(test_item) | should | be_equal_to(set(['method', 'super']))
Exemplo n.º 9
0
    def test_does_not_mix_tags_from_different_classes_with_same_mixin(self):
        @tag('mixin')
        class Mixin(object):
            pass

        @tag('other')
        class Other(Mixin, unittest.TestCase):
            pass

        @tag('class')
        class Test(Mixin, unittest.TestCase):

            @tag('method')
            def test_method(self):
                pass
        test_item = Test('test_method')

        get_tags(test_item) |should| be_equal_to(
            set(['class', 'method', 'mixin']))
Exemplo n.º 10
0
    def test_does_not_mix_tags_from_different_classes_with_same_mixin(self):
        @tag('mixin')
        class Mixin(object):
            pass

        @tag('other')
        class Other(Mixin, unittest.TestCase):
            pass

        @tag('class')
        class Test(Mixin, unittest.TestCase):
            @tag('method')
            def test_method(self):
                pass

        test_item = Test('test_method')

        get_tags(test_item) | should | be_equal_to(
            set(['class', 'method', 'mixin']))