Пример #1
0
        def test_unsatisfied_expectation(self, test_class):
            TestClass = ClassDouble(test_class)

            expect_constructor(TestClass)
            with raises(MockExpectationError):
                verify()
            teardown()
Пример #2
0
        def test_unsatisfied_expectation(self, test_class):
            TestClass = ClassDouble(test_class)

            expect_constructor(TestClass)
            with raises(MockExpectationError):
                verify()
            teardown()
Пример #3
0
 def test_raises_if_you_expect_constructor(self, test_class):
     with raises(ConstructorDoubleError):
         expect_constructor(test_class)
Пример #4
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
Пример #5
0
        def test_with_invalid_args(self, test_class):
            TestClass = ClassDouble(test_class)

            with raises(VerifyingDoubleArgumentError):
                expect_constructor(TestClass).with_args(10)
            teardown()
Пример #6
0
        def test_satisfied_exception(self, test_class):
            TestClass = ClassDouble(test_class)

            expect_constructor(TestClass)

            TestClass(*VALID_ARGS[test_class])
Пример #7
0
 def test_raises_if_you_expect_constructor(self, test_class):
     with raises(ConstructorDoubleError):
         expect_constructor(test_class)
Пример #8
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
Пример #9
0
        def test_with_invalid_args(self, test_class):
            TestClass = ClassDouble(test_class)

            with raises(VerifyingDoubleArgumentError):
                expect_constructor(TestClass).with_args(10)
            teardown()
Пример #10
0
        def test_satisfied_exception(self, test_class):
            TestClass = ClassDouble(test_class)

            expect_constructor(TestClass)

            TestClass(*VALID_ARGS[test_class])