Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Andrew/fix tests #183

Merged
merged 2 commits into from
Jan 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)