Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #6
0
 def test_if_not_raises_error_on_empty_arg_list_on_lambda(self):
     validate_if_callable_without_args(lambda: 0)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #11
0
    def test_if_not_rases_error_on_class_without_constructor(self):
        class FakeClass(object):
            pass

        validate_if_callable_without_args(FakeClass)
Beispiel #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)
Beispiel #13
0
 def test_if_not_raises_error_on_empty_arg_list_on_lambda(self):
     validate_if_callable_without_args(lambda: 0)
Beispiel #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)
Beispiel #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)
Beispiel #16
0
    def test_if_not_rases_error_on_class_without_constructor(self):
        class FakeClass(object):
            pass

        validate_if_callable_without_args(FakeClass)
Beispiel #17
0
 def test_if_raises_error_on_non_collable(self):
     with pytest.raises(TypeError):
         validate_if_callable_without_args(1)
Beispiel #18
0
 def test_if_raises_error_on_non_collable(self):
     with pytest.raises(TypeError):
         validate_if_callable_without_args(1)