Ejemplo n.º 1
0
    def test_if_raises_error_on_not_empty_arg_list_on_method(self):
        class FakeClass(object):
            def method_with_args(self, a):
                pass

        with pytest.raises(SignatureError):
            validate_if_callable_without_args(FakeClass.method_with_args)
Ejemplo n.º 2
0
    def test_if_raises_error_on_not_empty_arg_list_on_method(self):
        class FakeClass(object):
            def method_with_args(self, a):
                pass

        with pytest.raises(SignatureError):
            validate_if_callable_without_args(FakeClass.method_with_args)
Ejemplo n.º 3
0
    def test_if_rases_error_on_class_with_constructor_with_args(self):
        class FakeClass(object):
            def __init__(self, a):
                pass

        with pytest.raises(SignatureError):
            validate_if_callable_without_args(FakeClass)
Ejemplo n.º 4
0
    def test_if_rases_error_on_class_with_constructor_with_args(self):
        class FakeClass(object):
            def __init__(self, a):
                pass

        with pytest.raises(SignatureError):
            validate_if_callable_without_args(FakeClass)
Ejemplo n.º 5
0
    def test_if_not_rases_error_on_method_without_args(self):
        class FakeClass(object):
            def method_without_args(self):
                pass

        validate_if_callable_without_args(FakeClass.method_without_args)
Ejemplo n.º 6
0
 def test_if_not_raises_error_on_empty_arg_list_on_lambda(self):
     validate_if_callable_without_args(lambda: 0)
Ejemplo n.º 7
0
    def test_if_not_raises_error_on_empty_arg_list_on_function(self):
        def fake_func():
            pass

        validate_if_callable_without_args(fake_func)
Ejemplo n.º 8
0
 def test_if_raises_error_on_non_empty_args_list_on_lambda(self):
     with pytest.raises(TypeError):
         validate_if_callable_without_args(lambda x: x)
Ejemplo n.º 9
0
    def test_if_raises_error_on_non_empty_args_list_on_function(self):
        def fake_func(a):
            return a

        with pytest.raises(TypeError):
            validate_if_callable_without_args(fake_func)
Ejemplo n.º 10
0
    def test_if_raises_error_on_non_empty_args_list_on_function(self):
        def fake_func(a):
            return a

        with pytest.raises(TypeError):
            validate_if_callable_without_args(fake_func)
Ejemplo n.º 11
0
    def test_if_not_rases_error_on_class_without_constructor(self):
        class FakeClass(object):
            pass

        validate_if_callable_without_args(FakeClass)
Ejemplo n.º 12
0
    def test_if_not_rases_error_on_method_without_args(self):
        class FakeClass(object):
            def method_without_args(self):
                pass

        validate_if_callable_without_args(FakeClass.method_without_args)
Ejemplo n.º 13
0
 def test_if_not_raises_error_on_empty_arg_list_on_lambda(self):
     validate_if_callable_without_args(lambda: 0)
Ejemplo n.º 14
0
    def test_if_not_raises_error_on_empty_arg_list_on_function(self):
        def fake_func():
            pass

        validate_if_callable_without_args(fake_func)
Ejemplo n.º 15
0
 def test_if_raises_error_on_non_empty_args_list_on_lambda(self):
     with pytest.raises(TypeError):
         validate_if_callable_without_args(lambda x: x)
Ejemplo n.º 16
0
    def test_if_not_rases_error_on_class_without_constructor(self):
        class FakeClass(object):
            pass

        validate_if_callable_without_args(FakeClass)
Ejemplo n.º 17
0
 def test_if_raises_error_on_non_collable(self):
     with pytest.raises(TypeError):
         validate_if_callable_without_args(1)
Ejemplo n.º 18
0
 def test_if_raises_error_on_non_collable(self):
     with pytest.raises(TypeError):
         validate_if_callable_without_args(1)