Skip to content

Commit 29ab5ea

Browse files
author
Michael Johansen
committed
Update unit tests based on PR feedback.
Signed-off-by: Michael Johansen <[email protected]>
1 parent 9af630d commit 29ab5ea

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/unit/test_convert.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
(tests.types.MyStrEnum.VALUE1, "str"),
5656
(tests.types.MixinStrEnum.VALUE11, "str"),
5757
(dt.datetime.now(), "datetime"),
58+
(dt.timedelta(days=1), "timedelta"),
5859
([False, False], "Collection.bool"),
5960
([b"mystr", b"mystr"], "Collection.bytes"),
6061
([456.2, 1.0], "Collection.float"),
@@ -136,7 +137,7 @@ def test___python_datetime_datetime___to_any___valid_timestamppb2_value() -> Non
136137

137138

138139
def test___python_datetime_timedelta___to_any___valid_durationpb2_value() -> None:
139-
expected_value = dt.timedelta(days=1, seconds=1, microseconds=1)
140+
expected_value = dt.timedelta(days=1, seconds=2, microseconds=3)
140141
result = nipanel._convert.to_any(expected_value)
141142
unpack_dest = duration_pb2.Duration()
142143
_assert_any_and_unpack(result, unpack_dest)
@@ -210,7 +211,7 @@ def test___timestamppb2_timestamp___from_any___valid_python_value() -> None:
210211

211212

212213
def test___durationpb2_timestamp___from_any___valid_python_value() -> None:
213-
expected_value = dt.timedelta(weeks=1, hours=1, minutes=1)
214+
expected_value = dt.timedelta(weeks=1, hours=2, minutes=3)
214215
pb_value = duration_pb2.Duration()
215216
pb_value.FromTimedelta(expected_value)
216217
packed_any = _pack_into_any(pb_value)

0 commit comments

Comments
 (0)