def test_obstinatenamechooser(self): container = TestContainer() container[u'foobar'] = Contained() renamer = IContainerItemRenamer(container) renamer.renameItem(u'foobar', u'newname') self.assertEqual(list(container), [u'foobar'])
def testDeletion(self): from zope.event import subscribers tree = BTreeContainer() item = Contained() tree['42'] = item events = [] def subscriber(event): events.append(event) # events should happen after the deletion, not before) self.assertEqual(len(tree), 0) self.assertEqual(list(tree), []) subscribers.append(subscriber) del tree['42'] self.assertEqual(item.__name__, None) self.assertEqual(item.__parent__, None) self.assertEqual(len(events), 2) self.assertTrue(IObjectRemovedEvent.providedBy(events[0])) self.assertTrue(IContainerModifiedEvent.providedBy(events[1]))
def __init__(self): Persistent.__init__(self) Contained.__init__(self) self.task_id = celery.utils.uuid()
def __init__(self, title=None, activity_type=None): Contained.__init__(self) self.title = title self.activity_type = activity_type
def __init__(self, first, last, title=None, timezone='UTC'): Contained.__init__(self) self.title = title self.first = first self.last = last self.timezone = timezone
def __init__(self): Persistent.__init__(self) Contained.__init__(self) self.uids = OOBTree() self.data = OOBTree()
def __init__(self, tstart, duration, activity_type=None): Contained.__init__(self) self.tstart = tstart self.duration = duration self.activity_type = activity_type
def __init__(self, requirement, scoreSystem, value, evaluator): Contained.__init__(self) Score.__init__(self, scoreSystem, value) self.requirement = requirement self.evaluator = evaluator