msg = "cannot pack unknown node as child %s" % str(name)
raise CannotPackUnknownNodeError(msg)
a.set_node(name, child_node, metadata)
- return self._node.modify(a.modify)
+ d = self._node.modify(a.modify)
+ d.addCallback(lambda ign: self)
+ return d
def set_node(self, name, child, metadata=None, overwrite=True):
"""I add a child at the specific name. I return a Deferred that fires
"""Add multiple children (by writecap+readcap) to a directory node.
Takes a dictionary, with childname as keys and (writecap, readcap)
tuples (or (writecap, readcap, metadata) triples) as values. Returns
- a Deferred that fires (with None) when the operation finishes. This
- is equivalent to calling set_uri() multiple times, but is much more
- efficient. All child names must be unicode strings.
+ a Deferred that fires (with this dirnode) when the operation
+ finishes. This is equivalent to calling set_uri() multiple times, but
+ is much more efficient. All child names must be unicode strings.
"""
def set_node(name, child, metadata=None, overwrite=True):
u"e3": (fake_file_uri, fake_file_uri,
{"key": "value"}),
}))
+ d.addCallback(lambda n2: self.failUnlessIdentical(n2, n))
d.addCallback(lambda res:
self.shouldFail(ExistingChildError, "set_children-no",
"child 'e1' already exists",