Move LoggingServiceParent back to common

This commit is contained in:
Chad Whitacre 2020-09-30 22:27:24 -04:00
parent 9ecf9f120f
commit 2c2b61676c
3 changed files with 9 additions and 9 deletions

View File

@ -46,6 +46,7 @@ from testtools.twistedsupport import (
flush_logged_errors,
)
from twisted.application import service
from twisted.plugin import IPlugin
from twisted.internet import defer
from twisted.internet.defer import inlineCallbacks, returnValue
@ -88,7 +89,7 @@ from .eliotutil import (
EliotLoggedRunTest,
)
# Backwards compatibility imports:
from .common_py3 import LoggingServiceParent, ShouldFailMixin # noqa: F401
from .common_py3 import ShouldFailMixin # noqa: F401
TEST_RSA_KEY_SIZE = 522
@ -781,6 +782,11 @@ def create_mutable_filenode(contents, mdmf=False, all_contents=None):
return filenode
class LoggingServiceParent(service.MultiService):
def log(self, *args, **kwargs):
return log.msg(*args, **kwargs)
TEST_DATA=b"\x02"*(Uploader.URI_LIT_SIZE_THRESHOLD+1)

View File

@ -19,13 +19,11 @@ import time
import signal
from twisted.internet import defer, reactor
from twisted.application import service
from twisted.python import failure
from twisted.trial import unittest
from ..util.assertutil import precondition
from ..util.encodingutil import unicode_platform, get_filesystem_encoding
from ..util import log
class TimezoneMixin(object):
@ -163,8 +161,3 @@ class FakeCanary(object):
return None
def getPeer(self):
return "<fake>"
class LoggingServiceParent(service.MultiService):
def log(self, *args, **kwargs):
return log.msg(*args, **kwargs)

View File

@ -51,7 +51,8 @@ from allmydata.test.no_network import NoNetworkServer
from allmydata.storage_client import (
_StorageServer,
)
from .common_py3 import FakeCanary, LoggingServiceParent, ShouldFailMixin
from .common import LoggingServiceParent
from .common_py3 import FakeCanary, ShouldFailMixin
class UtilTests(unittest.TestCase):