예제 #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))