trivial: a few improvements to in-line doc and code, and renaming of test/test_immutable_checker.py to test/test_immutable.py

That file currently tests checker and verifier and repairer, and will soon also test downloader.
This commit is contained in:
Zooko O'Whielacronx 2009-01-02 16:49:41 -07:00
parent a52b5542e9
commit cc70c163ba
3 changed files with 5 additions and 2 deletions

View File

@ -802,7 +802,7 @@ class FileDownloader(log.PrefixingLogMixin):
self._results.timings["peer_selection"] = now - self._started
if len(self._share_buckets) < self._uri.needed_shares:
raise NotEnoughSharesError
raise NotEnoughSharesError(len(self._share_buckets), self._uri.needed_shares)
#for s in self._share_vbuckets.values():
# for vb in s:

View File

@ -344,6 +344,9 @@ class BucketReader(Referenceable):
self.storage_index = storage_index
self.shnum = shnum
def __repr__(self):
return "<%s %s %s>" % (self.__class__.__name__, base32.b2a_l(self.storage_index[:8], 60), self.shnum)
def remote_read(self, offset, length):
start = time.time()
data = self._share_file.read_share_data(offset, length)

View File

@ -288,7 +288,7 @@ class Test(ShareManglingMixin, unittest.TestCase):
# download it is more to test this test code than to test the Tahoe code...
def _then_delete_8(unused=None):
self.replace_shares(stash[0], storage_index=self.uri.storage_index)
for sharenum in range(2, 10):
for i in range(8):
self._delete_a_share()
d.addCallback(_then_delete_8)