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

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

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