Commit 4144e075 authored by Hanno Schlichting's avatar Hanno Schlichting

Expand tests, only test_explicit_wrapper_(true|false) segfault

parent d4696886
...@@ -2466,47 +2466,36 @@ class TestParent(unittest.TestCase): ...@@ -2466,47 +2466,36 @@ class TestParent(unittest.TestCase):
class TestAcquire(unittest.TestCase): class TestAcquire(unittest.TestCase):
def test_explicit_default(self): def setUp(self):
class Impl(Acquisition.Implicit): class Impl(Acquisition.Implicit):
pass pass
class Expl(Acquisition.Explicit): class Expl(Acquisition.Explicit):
pass pass
a = Impl('a') a = Impl('a')
a.y = 42 a.y = 42
a.b = Expl('b') a.b = Expl('b')
a.b.z = 3 a.b.z = 3
a.b.c = Impl('c') a.b.c = Impl('c')
value = a.b.c.aq_acquire('z') self.a = a
self.assertEqual(value, 3) self.acquire = Acquisition.aq_acquire
def test_explicit_true(self): def test_explicit_module_default(self):
class Impl(Acquisition.Implicit): self.assertEqual(self.acquire(self.a.b.c, 'z'), 3)
pass
class Expl(Acquisition.Explicit):
pass
a = Impl('a') def test_explicit_module_true(self):
a.y = 42 self.assertEqual(self.acquire(self.a.b.c, 'z', explicit=True), 3)
a.b = Expl('b')
a.b.z = 3
a.b.c = Impl('c')
value = a.b.c.aq_acquire('z', explicit=True)
self.assertEqual(value, 3)
def test_explicit_false(self): def test_explicit_module_false(self):
class Impl(Acquisition.Implicit): self.assertEqual(self.acquire(self.a.b.c, 'z', explicit=False), 3)
pass
class Expl(Acquisition.Explicit):
pass
a = Impl('a') def test_explicit_wrapper_default(self):
a.y = 42 self.assertEqual(self.a.b.c.aq_acquire('z'), 3)
a.b = Expl('b')
a.b.z = 3 def test_explicit_wrapper_true(self):
a.b.c = Impl('c') self.assertEqual(self.a.b.c.aq_acquire('z', explicit=True), 3)
value = a.b.c.aq_acquire('z', explicit=False)
self.assertEqual(value, 3) def test_explicit_wrapper_false(self):
self.assertEqual(self.a.b.c.aq_acquire('z', explicit=False), 3)
class TestUnicode(unittest.TestCase): class TestUnicode(unittest.TestCase):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment