Exemplo n.º 1
0
 def test_get_subnode_create(self):
     """Acceder a un nodo no existente con create debe crear
     la ruta completa.
     """
     path = '/foo/bar/spam'
     root = PubSubNode()
     root.get_subnode(path, True)
     try:
         node = root.get_subnode(path)
     except KeyError:
         self.fail('get_node() has not created subnode!')
     self.assertEqual(node.path, path)
Exemplo n.º 2
0
 def test_get_subnode_key_error(self):
     """Acceder a un nodo no existente sin create debe fallar.
     """
     root = PubSubNode()
     with self.assertRaises(KeyError):
         root.get_subnode('/foo/bar/spam')