[Zope3-checkins] CVS: Zope3/src/zope/proxy/context/tests - test_decorator.py:1.6
Steve Alexander
steve@cat-box.net
Sun, 11 May 2003 12:31:23 -0400
Update of /cvs-repository/Zope3/src/zope/proxy/context/tests
In directory cvs.zope.org:/tmp/cvs-serv19516/src/zope/proxy/context/tests
Modified Files:
test_decorator.py
Log Message:
Added check that an attribute on a mixin instance can be retrived via
the decorator.
=== Zope3/src/zope/proxy/context/tests/test_decorator.py 1.5 => 1.6 ===
--- Zope3/src/zope/proxy/context/tests/test_decorator.py:1.5 Fri May 9 12:01:00 2003
+++ Zope3/src/zope/proxy/context/tests/test_decorator.py Sun May 11 12:31:21 2003
@@ -119,7 +119,7 @@
class MixinFactory(object):
def __init__(self, inner, outer):
- pass
+ self.someinstanceattr = 42
def foo(self):
pass
def bar(self):
@@ -128,7 +128,7 @@
c = object()
f = MixinFactory
- n = ('foo', 'spoo')
+ n = ('foo', 'spoo', 'someinstanceattr')
w = self.proxy_class(obj, c, f, n)
self.assert_(decorator.getmixin(w) is None)
@@ -141,6 +141,8 @@
mixin2 = decorator.getmixin(w)
self.assert_(mixin is mixin2)
self.assertEqual(w.spoo, 23)
+ # Check that an attribute on the mixin object can be retrieved.
+ self.assertEquals(w.someinstanceattr, 42)
def test_typeerror_if_no_factory(self):
w = self.proxy_class(object(), None, None, ('foo',))
@@ -171,7 +173,7 @@
del w.foo
self.failIf(hasattr(mixin, 'fooval'))
- # check that trying to set something in attrdict fails.
+ # Check that trying to set something in attrdict fails.
self.assertRaises(AttributeError, setattr, w, 'baz', 23)
self.assertRaises(AttributeError, delattr, w, 'baz')