mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-01-20 03:36:25 +00:00
move testutil into test/common_util.py, since it doesn't count as 'code under test' for our pyflakes numbers
This commit is contained in:
parent
294e3fb682
commit
b73c380cdb
@ -16,9 +16,10 @@ from allmydata.checker_results import CheckerResults, CheckAndRepairResults, \
|
||||
DeepCheckResults, DeepCheckAndRepairResults
|
||||
from allmydata.mutable.common import CorruptShareError
|
||||
from allmydata.storage import storage_index_to_dir
|
||||
from allmydata.util import log, testutil, fileutil, pollmixin
|
||||
from allmydata.util import log, fileutil, pollmixin
|
||||
from allmydata.stats import PickleStatsGatherer
|
||||
from allmydata.key_generator import KeyGeneratorService
|
||||
import common_util as testutil
|
||||
|
||||
|
||||
def flush_but_dont_ignore(res):
|
||||
|
@ -7,8 +7,9 @@ from twisted.python import log
|
||||
import allmydata
|
||||
from allmydata import client
|
||||
from allmydata.introducer.client import IntroducerClient
|
||||
from allmydata.util import base32, testutil
|
||||
from allmydata.util import base32
|
||||
from foolscap.eventual import flushEventualQueue
|
||||
import common_util as testutil
|
||||
|
||||
class FakeIntroducerClient(IntroducerClient):
|
||||
def __init__(self):
|
||||
|
@ -9,11 +9,12 @@ from allmydata.interfaces import IURI, IClient, IMutableFileNode, \
|
||||
INewDirectoryURI, IReadonlyNewDirectoryURI, IFileNode, \
|
||||
ExistingChildError, NoSuchChildError, \
|
||||
IDeepCheckResults, IDeepCheckAndRepairResults
|
||||
from allmydata.util import hashutil, testutil
|
||||
from allmydata.util import hashutil
|
||||
from allmydata.monitor import Monitor
|
||||
from allmydata.test.common import make_chk_file_uri, make_mutable_file_uri, \
|
||||
FakeDirectoryNode, create_chk_filenode
|
||||
from allmydata.checker_results import CheckerResults, CheckAndRepairResults
|
||||
import common_util as testutil
|
||||
|
||||
# to test dirnode.py, we want to construct a tree of real DirectoryNodes that
|
||||
# contain pointers to fake files. We start with a fake MutableFileNode that
|
||||
|
@ -7,9 +7,10 @@ from twisted.python.failure import Failure
|
||||
from foolscap import eventual
|
||||
from allmydata import hashtree, uri
|
||||
from allmydata.immutable import encode, upload, download
|
||||
from allmydata.util import hashutil, testutil
|
||||
from allmydata.util import hashutil
|
||||
from allmydata.util.assertutil import _assert
|
||||
from allmydata.interfaces import IStorageBucketWriter, IStorageBucketReader, NotEnoughSharesError
|
||||
import common_util as testutil
|
||||
|
||||
class LostPeerError(Exception):
|
||||
pass
|
||||
|
@ -1,11 +1,11 @@
|
||||
from allmydata.immutable import upload
|
||||
from allmydata.test.common import SystemTestMixin, ShareManglingMixin
|
||||
from allmydata.util import testutil
|
||||
from allmydata.monitor import Monitor
|
||||
from allmydata.interfaces import IURI, NotEnoughSharesError
|
||||
from twisted.internet import defer
|
||||
from twisted.trial import unittest
|
||||
import random, struct
|
||||
import common_util as testutil
|
||||
|
||||
TEST_DATA="\x02"*(upload.Uploader.URI_LIT_SIZE_THRESHOLD+1)
|
||||
|
||||
|
@ -14,7 +14,8 @@ from allmydata.introducer.server import IntroducerService
|
||||
# test compatibility with old introducer .tac files
|
||||
from allmydata.introducer import IntroducerNode
|
||||
from allmydata.introducer import old
|
||||
from allmydata.util import testutil, idlib, pollmixin
|
||||
from allmydata.util import idlib, pollmixin
|
||||
import common_util as testutil
|
||||
|
||||
class FakeNode(Referenceable):
|
||||
pass
|
||||
|
@ -1,8 +1,8 @@
|
||||
|
||||
from allmydata.util import iputil, testutil
|
||||
|
||||
from twisted.trial import unittest
|
||||
import re
|
||||
from twisted.trial import unittest
|
||||
from allmydata.util import iputil
|
||||
import common_util as testutil
|
||||
|
||||
DOTTED_QUAD_RE=re.compile("^[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+$")
|
||||
|
||||
|
@ -6,7 +6,7 @@ from twisted.internet import defer, reactor
|
||||
from twisted.python import failure
|
||||
from allmydata import uri, storage
|
||||
from allmydata.immutable import download
|
||||
from allmydata.util import base32, testutil, idlib
|
||||
from allmydata.util import base32, idlib
|
||||
from allmydata.util.idlib import shortnodeid_b2a
|
||||
from allmydata.util.hashutil import tagged_hash
|
||||
from allmydata.util.fileutil import make_dirs
|
||||
@ -29,6 +29,8 @@ from allmydata.mutable.servermap import ServerMap, ServermapUpdater
|
||||
from allmydata.mutable.layout import unpack_header, unpack_share
|
||||
from allmydata.mutable.repair import MustForceRepairError
|
||||
|
||||
import common_util as testutil
|
||||
|
||||
# this "FastMutableFileNode" exists solely to speed up tests by using smaller
|
||||
# public/private keys. Once we switch to fast DSA-based keys, we can get rid
|
||||
# of this.
|
||||
|
@ -7,7 +7,8 @@ from twisted.python import log
|
||||
from foolscap.eventual import flushEventualQueue
|
||||
from twisted.application import service
|
||||
from allmydata.node import Node, formatTimeTahoeStyle
|
||||
from allmydata.util import testutil, fileutil
|
||||
from allmydata.util import fileutil
|
||||
import common_util as testutil
|
||||
|
||||
class LoggingMultiService(service.MultiService):
|
||||
def log(self, msg, **kw):
|
||||
|
@ -2,7 +2,8 @@
|
||||
from twisted.trial import unittest
|
||||
from twisted.application import service
|
||||
from allmydata.stats import CPUUsageMonitor
|
||||
from allmydata.util import testutil, pollmixin
|
||||
from allmydata.util import pollmixin
|
||||
import common_util as testutil
|
||||
|
||||
class FasterMonitor(CPUUsageMonitor):
|
||||
POLL_INTERVAL = 0.1
|
||||
|
@ -1,18 +1,18 @@
|
||||
|
||||
import os
|
||||
from cStringIO import StringIO
|
||||
from twisted.trial import unittest
|
||||
from twisted.python.failure import Failure
|
||||
from twisted.python import log
|
||||
from twisted.internet import defer
|
||||
from cStringIO import StringIO
|
||||
from foolscap import eventual
|
||||
|
||||
from allmydata import uri
|
||||
from allmydata.immutable import upload
|
||||
from allmydata.interfaces import IFileURI, FileTooLargeError, NotEnoughSharesError
|
||||
from allmydata.util.assertutil import precondition
|
||||
from allmydata.util.deferredutil import DeferredListShouldSucceed
|
||||
from allmydata.util.testutil import ShouldFailMixin
|
||||
from foolscap import eventual
|
||||
from common_util import ShouldFailMixin
|
||||
|
||||
MiB = 1024*1024
|
||||
|
||||
|
@ -7,7 +7,7 @@ from twisted.internet import defer, reactor
|
||||
from twisted.python import failure
|
||||
|
||||
from allmydata.util import base32, idlib, humanreadable, mathutil, hashutil
|
||||
from allmydata.util import assertutil, fileutil, testutil, deferredutil
|
||||
from allmydata.util import assertutil, fileutil, deferredutil
|
||||
from allmydata.util import limiter, time_format, pollmixin
|
||||
|
||||
class Base32(unittest.TestCase):
|
||||
|
@ -8,12 +8,13 @@ from twisted.python import failure, log
|
||||
from allmydata import interfaces, provisioning, uri, webish
|
||||
from allmydata.immutable import upload, download
|
||||
from allmydata.web import status, common
|
||||
from allmydata.util import fileutil, testutil, base32
|
||||
from allmydata.util import fileutil, base32
|
||||
from allmydata.test.common import FakeDirectoryNode, FakeCHKFileNode, \
|
||||
FakeMutableFileNode, create_chk_filenode
|
||||
from allmydata.interfaces import IURI, INewDirectoryURI, \
|
||||
IReadonlyNewDirectoryURI, IFileURI, IMutableFileURI, IMutableFileNode
|
||||
from allmydata.mutable import servermap, publish, retrieve
|
||||
import common_util as testutil
|
||||
|
||||
# create a fake uploader/downloader, and a couple of fake dirnodes, then
|
||||
# create a webserver that works against them
|
||||
|
Loading…
Reference in New Issue
Block a user