def test_delete_of_data_in_zk(self): path = '%s/unittest-delete' % self.sandbox data = {'unittest': 'data'} datanode = DataNode(zk=self.zk, path=path, data=data) # If the object is deleted in Zookeeper, our DataNode should reflect # that. It should also be able to re-update the value when told to. def get_stat_from_watcher(): return datanode._watcher.get()['stat'] # First, delete the path self.zk.delete(path) waituntil(get_stat_from_watcher, None, 5, mode=2) # Validate that the path is deleted, and the DataNode object was # updated correctly self.assertEquals(None, datanode.get()['data']) self.assertEquals(None, datanode.get()['stat'])