コード例 #1
0
ファイル: class_double_test.py プロジェクト: thedrow/doubles
 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
ファイル: class_double_test.py プロジェクト: thedrow/doubles
        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
ファイル: class_double_test.py プロジェクト: thedrow/doubles
        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
ファイル: class_double_test.py プロジェクト: thedrow/doubles
        def test_with_invalid_args(self, test_class):
            TestClass = ClassDouble(test_class)

            with raises(VerifyingDoubleArgumentError):
                expect_constructor(TestClass).with_args(10)
            teardown()
コード例 #5
0
ファイル: class_double_test.py プロジェクト: thedrow/doubles
        def test_satisfied_exception(self, test_class):
            TestClass = ClassDouble(test_class)

            expect_constructor(TestClass)

            TestClass(*VALID_ARGS[test_class])