def testDowncast(self): sw=StealWorker(debug_id='bob builder') sw.save() workers=NodeSet(debug_id='workers') workers.save() sw.add_to_parent(workers) for o in workers.flatten(klass=Worker): self.assertTrue(o.__class__==Worker) for o in workers.flatten(klass=StealWorker): self.assertTrue(o.__class__==StealWorker)
def _group(name, *children): g = NodeSet(debug_id=name) g.save() g.add_children(*children) return g