def test_failureStructurePreserved(self) -> None:
    '\n        Round-tripping a failure through L{eventAsJSON} preserves its class and\n        structure.\n        '
    events: List[LogEvent] = []
    log = Logger(observer=cast(ILogObserver, events.append))
    try:
        (1 / 0)
    except ZeroDivisionError:
        f = Failure()
        log.failure('a message about failure', f)
    self.assertEqual(len(events), 1)
    loaded = eventFromJSON(self.savedEventJSON(events[0]))['log_failure']
    self.assertIsInstance(loaded, Failure)
    self.assertTrue(loaded.check(ZeroDivisionError))
    self.assertIsInstance(loaded.getTraceback(), str)
Round-tripping a failure through L{eventAsJSON} preserves its class and
structure.
def test_failureStructurePreserved(self) -> None:
    '\n        Round-tripping a failure through L{eventAsJSON} preserves its class and\n        structure.\n        '
    events: List[LogEvent] = []
    log = Logger(observer=cast(ILogObserver, events.append))
    try:
        (1 / 0)
    except ZeroDivisionError:
        f = Failure()
        log.failure('a message about failure', f)
    self.assertEqual(len(events), 1)
    loaded = eventFromJSON(self.savedEventJSON(events[0]))['log_failure']
    self.assertIsInstance(loaded, Failure)
    self.assertTrue(loaded.check(ZeroDivisionError))
    self.assertIsInstance(loaded.getTraceback(), str)