示例#1
0
 def test_json_serialization(self):
     e = Event(timestamp=datetime.now(timezone.utc),
               duration=timedelta(hours=13, minutes=37),
               data={"key": "val"})
     json_str = e.to_json_str()
     logging.error(json_str)
     assert e == Event(**json.loads(json_str))
示例#2
0
def test_json_serialization() -> None:
    e = Event(timestamp=now,
              duration=timedelta(hours=13, minutes=37),
              data={"key": "val"})
    assert e == Event(**json.loads(e.to_json_str()))
def test_json_serialization() -> None:
    e = Event(timestamp=now, duration=timedelta(hours=13, minutes=37), data={"key": "val"})
    assert e == Event(**json.loads(e.to_json_str()))