def get_verifier(self):
return self._uri.get_verifier().to_string()
+ def get_storage_index(self):
+ return self._uri._filenode_uri.storage_index
+
def check(self, verify=False, repair=False):
"""Perform a file check. See IChecker.check for details."""
return self._node.check(verify, repair)
def get_verifier(self):
return self.u.get_verifier()
+ def get_storage_index(self):
+ return self.u.storage_index
+
def check(self, verify=False, repair=False):
assert repair is False # not implemented yet
storage_index = self.u.storage_index
def get_verifier(self):
return None
+ def get_storage_index(self):
+ return None
+
def check(self, verify=False, repair=False):
# neither verify= nor repair= affect LIT files
r = Results(None)
it holds a share for the file or directory.
"""
+ def get_storage_index():
+ """Return a string with the (binary) storage index in use on this
+ download. This may be None if there is no storage index (i.e. LIT
+ files)."""
+
def check(verify=False, repair=False):
"""Perform a file check. See IChecker.check for details.
u_v = n.get_verifier()
self.failUnless(u_v.startswith("URI:DIR2-Verifier:"), u_v)
self.expected_manifest.append(u_v)
+ expected_si = n._uri._filenode_uri.storage_index
+ self.failUnlessEqual(n.get_storage_index(), expected_si)
d = n.list()
d.addCallback(lambda res: self.failUnlessEqual(res, {}))
self.failUnlessEqual(fn1.is_mutable(), False)
self.failUnlessEqual(fn1.get_readonly_uri(), u.to_string())
self.failUnlessEqual(fn1.get_size(), 1000)
+ self.failUnlessEqual(fn1.get_storage_index(), u.storage_index)
d = {}
d[fn1] = 1 # exercise __hash__
v = fn1.get_verifier()
self.failUnlessEqual(fn1.is_mutable(), False)
self.failUnlessEqual(fn1.get_readonly_uri(), u.to_string())
self.failUnlessEqual(fn1.get_size(), len(DATA))
+ self.failUnlessEqual(fn1.get_storage_index(), None)
d = {}
d[fn1] = 1 # exercise __hash__
d = self.client.create_mutable_file()
def _created(n):
self.failUnless(isinstance(n, FastMutableFileNode))
+ self.failUnlessEqual(n.get_storage_index(), n._storage_index)
peer0 = self.client._peerids[0]
shnums = self.client._storage._peers[peer0].keys()
self.failUnlessEqual(len(shnums), 1)