Ejemplo n.º 1
0
 def test_create(self):
     model = ZKCrudModel()
     model.create_makepath = False
     eff = Effect(zk.CreateNode(path='/foo', value="v"))
     dispatcher = get_zk_dispatcher(model)
     result = sync_perform(dispatcher, eff)
     self.assertEqual(model.nodes, {"/foo": ("v", 0)})
     self.assertEqual(result, '/foo')
Ejemplo n.º 2
0
 def test_create(self):
     model = ZKCrudModel()
     model.create_makepath = False
     eff = Effect(zk.CreateNode(path='/foo', value="v"))
     dispatcher = get_zk_dispatcher(model)
     result = sync_perform(dispatcher, eff)
     self.assertEqual(model.nodes, {"/foo": ("v", 0)})
     self.assertEqual(result, '/foo')
Ejemplo n.º 3
0
 def _gs(self, path):
     eff = Effect(GetStat(path))
     dispatcher = get_zk_dispatcher(self.model)
     return sync_perform(dispatcher, eff)
Ejemplo n.º 4
0
 def _gc(self, path):
     eff = Effect(GetChildren(path))
     dispatcher = get_zk_dispatcher(self.model)
     return sync_perform(dispatcher, eff)
Ejemplo n.º 5
0
 def _gcws(self, path):
     eff = Effect(GetChildrenWithStats(path))
     dispatcher = ComposedDispatcher([test_dispatcher(),
                                      get_zk_dispatcher(self.model)])
     return sync_perform(dispatcher, eff)
Ejemplo n.º 6
0
 def _gs(self, path):
     eff = Effect(GetStat(path))
     dispatcher = get_zk_dispatcher(self.model)
     return sync_perform(dispatcher, eff)
Ejemplo n.º 7
0
 def _gc(self, path):
     eff = Effect(GetChildren(path))
     dispatcher = get_zk_dispatcher(self.model)
     return sync_perform(dispatcher, eff)
Ejemplo n.º 8
0
 def _gcws(self, path):
     eff = Effect(GetChildrenWithStats(path))
     dispatcher = ComposedDispatcher(
         [test_dispatcher(),
          get_zk_dispatcher(self.model)])
     return sync_perform(dispatcher, eff)