Esempio n. 1
0
    def test_get_or_create_context(self):
        root = Context('root')
        self.assert_(root.get_or_create_context('root') is root)

        child = root.get_or_create_context('child')
        self.assert_(root.get_or_create_context('child') is child)
        self.assert_(child.get_or_create_context('child') is child)
Esempio n. 2
0
 def test_get_child_contexts(self):
     root = Context('root')
     child = root.get_or_create_context('child1')
     self.assert_(child.get_parent() is root)
     self.assert_(child in root.get_child_contexts())