示例#1
0
    def test_one_functions_with_self_parameter_raises_attributeerror(self) -> None:
        '''torment.fixtures._resolve_functions({ 'a': self → self.b, }, fixture)'''

        def a(self): return self.b  # flake8: noqa (one line function in tests)

        fixtures._resolve_functions({ 'a': a, }, self.f)

        self.assertEqual(id(self.f.a), id(a))
示例#2
0
    def test_one_functions_with_self_parameter(self) -> None:
        '''torment.fixtures._resolve_functions({ 'a': self → None, }, fixture)'''

        def a(self) -> None: pass  # flake8: noqa (one line function in tests)

        fixtures._resolve_functions({ 'a': a, }, self.f)

        self.assertIsNone(self.f.a)
示例#3
0
    def test_one_functions_without_parameters(self) -> None:
        '''torment.fixtures._resolve_functions({ 'a': ø → None, }, fixture)'''

        def a() -> None: pass  # flake8: noqa (one line function in tests)

        fixtures._resolve_functions({ 'a': a, }, self.f)

        self.assertEqual(id(self.f.a), id(a))
示例#4
0
    def test_one_functions_with_self_parameter(self) -> None:
        '''torment.fixtures._resolve_functions({ 'a': self → None, }, fixture)'''
        def a(self) -> None:
            pass

        fixtures._resolve_functions({
            'a': a,
        }, self.f)

        self.assertIsNone(self.f.a)
示例#5
0
    def test_one_functions_without_parameters(self) -> None:
        '''torment.fixtures._resolve_functions({ 'a': ø → None, }, fixture)'''
        def a() -> None:
            pass

        fixtures._resolve_functions({
            'a': a,
        }, self.f)

        self.assertEqual(id(self.f.a), id(a))
示例#6
0
    def test_many_functions(self) -> None:
        '''torment.fixtures._resolve_functions({ 'a': self → self.b, 'b': self → None, }, fixture)'''

        def a(self) -> None: return self.b  # flake8: noqa (one line function in tests)
        def b(self) -> None: pass  # flake8: noqa (one line function in tests)

        fixtures._resolve_functions({ 'a': a, 'b': b, }, self.f)

        self.assertIsNone(self.f.a)
        self.assertIsNone(self.f.b)
示例#7
0
    def test_one_functions_with_self_parameter_raises_attributeerror(
            self) -> None:
        '''torment.fixtures._resolve_functions({ 'a': self → self.b, }, fixture)'''
        def a(self):
            return self.b

        fixtures._resolve_functions({
            'a': a,
        }, self.f)

        self.assertEqual(id(self.f.a), id(a))
示例#8
0
文件: __init__.py 项目: devx/torment
    def test_many_functions(self) -> None:
        '''torment.fixtures._resolve_functions({ 'a': self → self.b, 'b': self → None, }, fixture)'''

        def a(self) -> None:
            return self.b

        def b(self) -> None:
            pass

        fixtures._resolve_functions({ 'a': a, 'b': b, }, self.f)

        self.assertIsNone(self.f.a)
        self.assertIsNone(self.f.b)
示例#9
0
    def test_many_functions(self) -> None:
        '''torment.fixtures._resolve_functions({ 'a': self → self.b, 'b': self → None, }, fixture)'''
        def a(self) -> None:
            return self.b

        def b(self) -> None:
            pass

        fixtures._resolve_functions({
            'a': a,
            'b': b,
        }, self.f)

        self.assertIsNone(self.f.a)
        self.assertIsNone(self.f.b)
示例#10
0
    def test_zero_functions(self) -> None:
        '''torment.fixtures._resolve_functions({}, fixture)'''

        fixtures._resolve_functions({}, self.f)

        self.assertEqual(dir(self.o), dir(self.f))
示例#11
0
文件: __init__.py 项目: devx/torment
    def test_zero_functions(self) -> None:
        '''torment.fixtures._resolve_functions({}, fixture)'''

        fixtures._resolve_functions({}, self.f)

        self.assertEqual(dir(self.o), dir(self.f))