Exemple #1
0
 def test_fails_with_positional_args_and_kwargs(self, type_):
     double = ClassDouble('doubles.testing.{}SubClass'.format(type_))
     with raises(VerifyingDoubleArgumentError):
         allow_constructor(double).with_args(1, 2, foo=1)
Exemple #2
0
        def test_with_valid_args(self, test_class):
            TestClass = ClassDouble(test_class)

            expect_constructor(TestClass).with_args(*VALID_ARGS[test_class])

            assert TestClass(*VALID_ARGS[test_class]) is None
Exemple #3
0
        def test_with_no_args(self, test_class):
            TestClass = ClassDouble(test_class)

            allow_constructor(TestClass)
            assert TestClass(*VALID_ARGS[test_class]) is None
Exemple #4
0
        def test_with_invalid_args(self, test_class):
            TestClass = ClassDouble(test_class)

            with raises(VerifyingDoubleArgumentError):
                expect_constructor(TestClass).with_args(10)
            teardown()
Exemple #5
0
        def test_satisfied_exception(self, test_class):
            TestClass = ClassDouble(test_class)

            expect_constructor(TestClass)

            TestClass(*VALID_ARGS[test_class])