Beispiel #1
0
    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)
Beispiel #2
0
def _group(name, *children):
    g = NodeSet(debug_id=name)
    g.save()
    g.add_children(*children)
    return g