def test_unsatisfied_expectation(self, test_class): TestClass = ClassDouble(test_class) expect_constructor(TestClass) with raises(MockExpectationError): verify() teardown()
def test_raises_if_you_expect_constructor(self, test_class): with raises(ConstructorDoubleError): expect_constructor(test_class)
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
def test_with_invalid_args(self, test_class): TestClass = ClassDouble(test_class) with raises(VerifyingDoubleArgumentError): expect_constructor(TestClass).with_args(10) teardown()
def test_satisfied_exception(self, test_class): TestClass = ClassDouble(test_class) expect_constructor(TestClass) TestClass(*VALID_ARGS[test_class])