test.common: allow test_repairer to be run independently

Previously, this file importing "allmydata.immutable" but assuming that
"allmydata.immutable.upload" was available, which only worked if some
other file had imported upload.py . This didn't affect running the
entire test suite (something imported upload.py before anything else
needed it), but caused errors when running specific tests like
test_repairer.py .
This commit is contained in:
Brian Warner 2016-08-05 18:26:18 -04:00
parent cd083b9a04
commit a35073cb3d

View File

@ -20,7 +20,7 @@ from allmydata.util import hashutil, log
from allmydata.util.assertutil import precondition from allmydata.util.assertutil import precondition
from allmydata.util.consumer import download_to_data from allmydata.util.consumer import download_to_data
import allmydata.test.common_util as testutil import allmydata.test.common_util as testutil
from allmydata import immutable from allmydata.immutable.upload import Uploader
TEST_RSA_KEY_SIZE = 522 TEST_RSA_KEY_SIZE = 522
@ -424,7 +424,7 @@ class LoggingServiceParent(service.MultiService):
return log.msg(*args, **kwargs) return log.msg(*args, **kwargs)
TEST_DATA="\x02"*(immutable.upload.Uploader.URI_LIT_SIZE_THRESHOLD+1) TEST_DATA="\x02"*(Uploader.URI_LIT_SIZE_THRESHOLD+1)
class ShouldFailMixin: class ShouldFailMixin:
def shouldFail(self, expected_failure, which, substring, def shouldFail(self, expected_failure, which, substring,