MCPcopy Create free account
hub / github.com/hynek/structlog / test_serializer

Method test_serializer

tests/processors/test_renderers.py:340–347  ·  view source on GitHub ↗

A custom serializer is used if specified.

(self)

Source from the content-addressed store, hash-verified

338 assert '{"date": "datetime.date(1980, 3, 25)"}' == s
339
340 def test_serializer(self):
341 """
342 A custom serializer is used if specified.
343 """
344 jr = JSONRenderer(serializer=lambda obj, **kw: {"a": 42})
345 obj = object()
346
347 assert {"a": 42} == jr(None, None, obj)
348
349 def test_custom_fallback(self):
350 """

Callers

nothing calls this directly

Calls 2

JSONRendererClass · 0.90
jrFunction · 0.85

Tested by

no test coverage detected