from allmydata.Crypto.Cipher import AES
from allmydata.uri import unpack_uri
from allmydata.interfaces import IDownloadTarget, IDownloader
-
-class NotEnoughPeersError(Exception):
- pass
+from allmydata.encode import NotEnoughPeersError
class HaveAllPeersError(Exception):
# we use this to jump out of the loop
from twisted.python.failure import Failure
from cStringIO import StringIO
-from allmydata import upload
+from allmydata import upload, encode
from allmydata.uri import unpack_uri
from test_encode import FakePeer
self.u.parent = self.node
def _should_fail(self, f):
- self.failUnless(isinstance(f, Failure) and f.check(upload.NotEnoughPeersError))
+ self.failUnless(isinstance(f, Failure) and f.check(encode.NotEnoughPeersError))
def testData(self):
data = "This is some data to upload"
from cStringIO import StringIO
import collections, random
-class NotEnoughPeersError(Exception):
- pass
-
class HaveAllPeersError(Exception):
# we use this to jump out of the loop
pass
# But we allocated places for enough shares.
log.msg("%s._locate_all_shareholders() But we allocated places for enough shares.")
return self.used_peers
- raise NotEnoughPeersError
+ raise encode.NotEnoughPeersError
# we need to keep trying
return self._locate_more_shareholders()