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

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

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