diff --git a/src/allmydata/test/test_eliotutil.py b/src/allmydata/test/test_eliotutil.py index 1a8c2f801..0073a7675 100644 --- a/src/allmydata/test/test_eliotutil.py +++ b/src/allmydata/test/test_eliotutil.py @@ -57,11 +57,14 @@ from ..util.eliotutil import ( _parse_destination_description, _EliotLogging, ) +from ..util.jsonbytes import BytesJSONEncoder + from .common import ( SyncTestCase, AsyncTestCase, ) + class EliotLoggedTestTests(AsyncTestCase): def test_returns_none(self): Message.log(hello="world") @@ -94,7 +97,7 @@ class ParseDestinationDescriptionTests(SyncTestCase): reactor = object() self.assertThat( _parse_destination_description("file:-")(reactor), - Equals(FileDestination(stdout)), + Equals(FileDestination(stdout, encoder=BytesJSONEncoder)), ) diff --git a/src/allmydata/util/eliotutil.py b/src/allmydata/util/eliotutil.py index 096356dfa..9e3cdd3e1 100644 --- a/src/allmydata/util/eliotutil.py +++ b/src/allmydata/util/eliotutil.py @@ -86,6 +86,9 @@ from twisted.internet.defer import ( ) from twisted.application.service import Service +from .jsonbytes import BytesJSONEncoder + + def validateInstanceOf(t): """ Return an Eliot validator that requires values to be instances of ``t``. @@ -302,7 +305,7 @@ class _DestinationParser(object): rotateLength=rotate_length, maxRotatedFiles=max_rotated_files, ) - return lambda reactor: FileDestination(get_file()) + return lambda reactor: FileDestination(get_file(), BytesJSONEncoder) _parse_destination_description = _DestinationParser().parse