[ "filenode", { "ro_uri": file_uri,
"size": bytes,
+ "mutable": false,
"metadata": {"ctime": 1202777696.7564139,
"mtime": 1202777696.7564139
}
[ "dirnode", { "rw_uri": read_write_uri,
"ro_uri": read_only_uri,
+ "mutable": true,
"children": {
"foo.txt": [ "filenode", { "ro_uri": uri,
"size": bytes,
self.failUnless(isinstance(data, list))
self.failUnlessEqual(data[0], "filenode")
self.failUnless(isinstance(data[1], dict))
+ self.failIf(data[1]["mutable"])
self.failIf("rw_uri" in data[1]) # immutable
self.failUnlessEqual(data[1]["ro_uri"], self._bar_txt_uri)
self.failUnlessEqual(data[1]["size"], len(self.BAR_CONTENTS))
self.failUnless(isinstance(data, list))
self.failUnlessEqual(data[0], "dirnode", res)
self.failUnless(isinstance(data[1], dict))
+ self.failUnless(data[1]["mutable"])
self.failUnless("rw_uri" in data[1]) # mutable
self.failUnlessEqual(data[1]["rw_uri"], self._foo_uri)
self.failUnlessEqual(data[1]["ro_uri"], self._foo_readonly_uri)
self.failUnless("new.txt" in children)
new_json = children["new.txt"]
self.failUnlessEqual(new_json[0], "filenode")
+ self.failUnless(new_json[1]["mutable"])
self.failUnlessEqual(new_json[1]["rw_uri"], self._mutable_uri)
ro_uri = unicode(self._mutable_node.get_readonly().to_string())
self.failUnlessEqual(new_json[1]["ro_uri"], ro_uri)
def _check_file_json(res):
parsed = simplejson.loads(res)
self.failUnlessEqual(parsed[0], "filenode")
+ self.failUnless(parsed[1]["mutable"])
self.failUnlessEqual(parsed[1]["rw_uri"], self._mutable_uri)
ro_uri = unicode(self._mutable_node.get_readonly().to_string())
self.failUnlessEqual(parsed[1]["ro_uri"], ro_uri)
kiddata[1]["ro_uri"] = ro_uri
if rw_uri:
kiddata[1]["rw_uri"] = rw_uri
+ kiddata[1]['mutable'] = childnode.is_mutable()
kids[name] = kiddata
if dirnode.is_readonly():
drw_uri = None
contents['ro_uri'] = dro_uri
if drw_uri:
contents['rw_uri'] = drw_uri
+ contents['mutable'] = dirnode.is_mutable()
data = ("dirnode", contents)
return simplejson.dumps(data, indent=1)
d.addCallback(_got)