From e6c94efa08ad969311d3a11fd3cafb9f768ba234 Mon Sep 17 00:00:00 2001 From: helmutm Date: Fri, 17 Mar 2006 15:36:21 +0000 Subject: [PATCH] slight improvement relation/tests/IntIdsStub: now registers on get git-svn-id: svn://svn.cy55.de/Zope3/src/cybertools/trunk@1128 fd906abe-77d9-0310-91a1-e0d9ade77398 --- relation/tests.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/relation/tests.py b/relation/tests.py index 67f942d..1e3a610 100755 --- a/relation/tests.py +++ b/relation/tests.py @@ -15,7 +15,7 @@ from cybertools.relation.interfaces import IRelationRegistry from cybertools.relation.registry import RelationRegistry -class IntIdsStub: +class IntIdsStub(object): """A testing stub (mock utility) for IntIds.""" implements(IIntIds) @@ -25,14 +25,14 @@ class IntIdsStub: def getObject(self, uid): return self.objs[uid] - def getId(self, ob): - return self.objs.index(ob) - def register(self, ob): if ob not in self.objs: self.objs.append(ob) return self.objs.index(ob) + getId = register + queryId = getId + def unregister(self, ob): id = self.getId(ob) self.objs[id] = None