]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
move FileTooLargeError out to a common location
authorBrian Warner <warner@allmydata.com>
Tue, 3 Jun 2008 07:01:15 +0000 (00:01 -0700)
committerBrian Warner <warner@allmydata.com>
Tue, 3 Jun 2008 07:01:15 +0000 (00:01 -0700)
src/allmydata/interfaces.py
src/allmydata/storage.py
src/allmydata/test/test_upload.py

index 5bcb1c7409d8c5bd0de93bc21b73b212d25a6822..8dac6fb6574fba526910296eb2f18bf398db3c13 100644 (file)
@@ -1867,3 +1867,8 @@ class RIKeyGenerator(RemoteInterface):
         @return: tuple(verifying_key, signing_key)
         """
         return TupleOf(str, str)
+
+
+class FileTooLargeError(Exception):
+    pass
+
index 443169626bed8c819018533c5c20f522d487dbeb..5687aadf71175d5409c4ffbb8356f09f1f3d9d74 100644 (file)
@@ -9,7 +9,7 @@ from twisted.internet import defer
 from zope.interface import implements
 from allmydata.interfaces import RIStorageServer, RIBucketWriter, \
      RIBucketReader, IStorageBucketWriter, IStorageBucketReader, HASH_SIZE, \
-     BadWriteEnablerError, IStatsProducer
+     BadWriteEnablerError, IStatsProducer, FileTooLargeError
 from allmydata.util import base32, fileutil, idlib, mathutil, log
 from allmydata.util.assertutil import precondition, _assert
 import allmydata # for __version__
@@ -1071,9 +1071,6 @@ def allocated_size(data_size, num_segments, num_share_hashes,
     uri_extension_starts_at = wbp._offsets['uri_extension']
     return uri_extension_starts_at + 4 + uri_extension_size
 
-class FileTooLargeError(Exception):
-    pass
-
 class WriteBucketProxy:
     implements(IStorageBucketWriter)
     def __init__(self, rref, data_size, segment_size, num_segments,
index e0f2c93d98cf59c6eeffa5fcbbf8478517dbac9e..7dd7e0088875cd766440f4ea9c038b25869e8682 100644 (file)
@@ -6,8 +6,8 @@ from twisted.python import log
 from twisted.internet import defer
 from cStringIO import StringIO
 
-from allmydata import upload, encode, uri, storage
-from allmydata.interfaces import IFileURI
+from allmydata import upload, encode, uri
+from allmydata.interfaces import IFileURI, FileTooLargeError
 from allmydata.util.assertutil import precondition
 from allmydata.util.deferredutil import DeferredListShouldSucceed
 from allmydata.util.testutil import ShouldFailMixin
@@ -240,12 +240,12 @@ class GoodServer(unittest.TestCase, ShouldFailMixin):
         k = 3; happy = 7; n = 10
         self.set_encoding_parameters(k, happy, n)
         data1 = GiganticUploadable(k*4*1024*1024*1024)
-        d = self.shouldFail(storage.FileTooLargeError, "test_too_large-data1",
+        d = self.shouldFail(FileTooLargeError, "test_too_large-data1",
                             "This file is too large to be uploaded (data_size)",
                             self.u.upload, data1)
         data2 = GiganticUploadable(k*4*1024*1024*1024-3)
         d.addCallback(lambda res:
-                      self.shouldFail(storage.FileTooLargeError,
+                      self.shouldFail(FileTooLargeError,
                                       "test_too_large-data2",
                                       "This file is too large to be uploaded (offsets)",
                                       self.u.upload, data2))