Skip to content

Commit

Permalink
Merge pull request #183 from plotly/andrew/fix_tests
Browse files Browse the repository at this point in the history
Andrew/fix tests
  • Loading branch information
ayjayt authored Jan 28, 2025
2 parents 325982f + 2372214 commit f0e9d56
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions tests/test_serializer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
from datetime import UTC, datetime
try:
from datetime import UTC, datetime
except ImportError:
from datetime import datetime, timezone

UTC = timezone.utc

import logistro
import numpy as np
Expand All @@ -25,10 +30,12 @@ async def test_de_serialize():
message = wire.serialize(data)
assert message == expected_message
obj = wire.deserialize(message)
for o, t in zip(obj, converted_type, strict=False):
assert len(obj) == len(converted_type)
for o, t in zip(obj, converted_type):
assert isinstance(o, t)
message_np = wire.serialize(np.array(data))
assert message_np == expected_message
obj_np = wire.deserialize(message_np)
for o, t in zip(obj_np, converted_type, strict=False):
assert len(obj_np) == len(converted_type)
for o, t in zip(obj_np, converted_type):
assert isinstance(o, t)

0 comments on commit f0e9d56

Please sign in to comment.