示例#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)
示例#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
示例#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
示例#4
0
        def test_with_invalid_args(self, test_class):
            TestClass = ClassDouble(test_class)

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

            expect_constructor(TestClass)

            TestClass(*VALID_ARGS[test_class])