mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2024-12-24 15:16:41 +00:00
Merge branch '3564.eliot-log-testing-python-3' into 3566.web-tests-python-3-part-2
This commit is contained in:
commit
b46898f667
@ -57,11 +57,14 @@ from ..util.eliotutil import (
|
|||||||
_parse_destination_description,
|
_parse_destination_description,
|
||||||
_EliotLogging,
|
_EliotLogging,
|
||||||
)
|
)
|
||||||
|
from ..util.jsonbytes import BytesJSONEncoder
|
||||||
|
|
||||||
from .common import (
|
from .common import (
|
||||||
SyncTestCase,
|
SyncTestCase,
|
||||||
AsyncTestCase,
|
AsyncTestCase,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class EliotLoggedTestTests(AsyncTestCase):
|
class EliotLoggedTestTests(AsyncTestCase):
|
||||||
def test_returns_none(self):
|
def test_returns_none(self):
|
||||||
Message.log(hello="world")
|
Message.log(hello="world")
|
||||||
@ -94,7 +97,7 @@ class ParseDestinationDescriptionTests(SyncTestCase):
|
|||||||
reactor = object()
|
reactor = object()
|
||||||
self.assertThat(
|
self.assertThat(
|
||||||
_parse_destination_description("file:-")(reactor),
|
_parse_destination_description("file:-")(reactor),
|
||||||
Equals(FileDestination(stdout)),
|
Equals(FileDestination(stdout, encoder=BytesJSONEncoder)),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -86,6 +86,9 @@ from twisted.internet.defer import (
|
|||||||
)
|
)
|
||||||
from twisted.application.service import Service
|
from twisted.application.service import Service
|
||||||
|
|
||||||
|
from .jsonbytes import BytesJSONEncoder
|
||||||
|
|
||||||
|
|
||||||
def validateInstanceOf(t):
|
def validateInstanceOf(t):
|
||||||
"""
|
"""
|
||||||
Return an Eliot validator that requires values to be instances of ``t``.
|
Return an Eliot validator that requires values to be instances of ``t``.
|
||||||
@ -302,7 +305,7 @@ class _DestinationParser(object):
|
|||||||
rotateLength=rotate_length,
|
rotateLength=rotate_length,
|
||||||
maxRotatedFiles=max_rotated_files,
|
maxRotatedFiles=max_rotated_files,
|
||||||
)
|
)
|
||||||
return lambda reactor: FileDestination(get_file())
|
return lambda reactor: FileDestination(get_file(), BytesJSONEncoder)
|
||||||
|
|
||||||
|
|
||||||
_parse_destination_description = _DestinationParser().parse
|
_parse_destination_description = _DestinationParser().parse
|
||||||
|
Loading…
Reference in New Issue
Block a user