Skip to content

Commit

Permalink
add more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
charbonnierg committed Mar 20, 2024
1 parent d2f515b commit 6634834
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions tests/test_js.py
Original file line number Diff line number Diff line change
Expand Up @@ -1396,6 +1396,30 @@ async def test_consumer_with_opt_start_time_microseconds_tz(self):
await nc.close()

def test_parser_consumer_info_with_created_timestamp(self):
for created in [
"1970-01-01T01:02:03Z",
"1970-01-01T02:02:03+01:00",
"1970-01-01T01:02:03.0Z",
"1970-01-01T01:02:03.00Z",
"1970-01-01T01:02:03.000Z",
"1970-01-01T01:02:03.0000Z",
"1970-01-01T01:02:03.00000Z",
"1970-01-01T01:02:03.000000Z",
"1970-01-01T01:02:03.0000000Z",
"1970-01-01T01:02:03.00000000Z",
"1970-01-01T01:02:03.000000000Z",
"1970-01-01T02:02:03.000000000Z+01:00",
]:
info = api.ConsumerInfo.from_response({
"name": "test",
"stream_name": "test",
"config": {},
"created": created
})
created = info.created
assert created == datetime.datetime(
1970, 1, 1, 1, 2, 3, tzinfo=datetime.timezone.utc
)
for created in [
"1970-01-01T01:02:03.4Z",
"1970-01-01T01:02:03.4+00:00",
Expand Down

0 comments on commit 6634834

Please sign in to comment.