@@ -1400,7 +1400,9 @@ async def test_consumer_with_opt_start_time_date_only(self):
1400
1400
deliver_policy = api .DeliverPolicy .BY_START_TIME ,
1401
1401
)
1402
1402
assert isinstance (con .created , datetime .datetime )
1403
- assert con .config .opt_start_time == datetime .datetime (1970 , 1 , 1 , tzinfo = datetime .timezone .utc )
1403
+ assert con .config .opt_start_time == datetime .datetime (
1404
+ 1970 , 1 , 1 , tzinfo = datetime .timezone .utc
1405
+ )
1404
1406
await nc .close ()
1405
1407
1406
1408
@async_test
@@ -1415,7 +1417,9 @@ async def test_consumer_with_opt_start_time_timestamp(self):
1415
1417
deliver_policy = api .DeliverPolicy .BY_START_TIME ,
1416
1418
)
1417
1419
assert isinstance (con .created , datetime .datetime )
1418
- assert con .config .opt_start_time == datetime .datetime (1970 , 1 , 1 , 1 , 1 , 1 , tzinfo = datetime .timezone .utc )
1420
+ assert con .config .opt_start_time == datetime .datetime (
1421
+ 1970 , 1 , 1 , 1 , 1 , 1 , tzinfo = datetime .timezone .utc
1422
+ )
1419
1423
await nc .close ()
1420
1424
1421
1425
@async_test
@@ -1426,12 +1430,21 @@ async def test_consumer_with_opt_start_time_microseconds(self):
1426
1430
await jsm .add_stream (name = "ctests" , subjects = ["a" , "b" , "c.>" ])
1427
1431
con = await jsm .add_consumer (
1428
1432
"ctests" ,
1429
- opt_start_time = datetime .datetime (1970 , 1 , 1 , 1 , 1 , 1 , microsecond = 123456 ),
1433
+ opt_start_time = datetime .datetime (
1434
+ 1970 , 1 , 1 , 1 , 1 , 1 , microsecond = 123456
1435
+ ),
1430
1436
deliver_policy = api .DeliverPolicy .BY_START_TIME ,
1431
1437
)
1432
1438
assert isinstance (con .created , datetime .datetime )
1433
1439
assert con .config .opt_start_time == datetime .datetime (
1434
- 1970 , 1 , 1 , 1 , 1 , 1 , microsecond = 123456 , tzinfo = datetime .timezone .utc
1440
+ 1970 ,
1441
+ 1 ,
1442
+ 1 ,
1443
+ 1 ,
1444
+ 1 ,
1445
+ 1 ,
1446
+ microsecond = 123456 ,
1447
+ tzinfo = datetime .timezone .utc
1435
1448
)
1436
1449
await nc .close ()
1437
1450
@@ -1443,11 +1456,15 @@ async def test_consumer_with_opt_start_time_date_tz(self):
1443
1456
await jsm .add_stream (name = "ctests" , subjects = ["a" , "b" , "c.>" ])
1444
1457
con = await jsm .add_consumer (
1445
1458
"ctests" ,
1446
- opt_start_time = datetime .datetime (1970 , 1 , 1 , tzinfo = pytz .timezone ("Europe/Paris" )),
1459
+ opt_start_time = datetime .datetime (
1460
+ 1970 , 1 , 1 , tzinfo = pytz .timezone ("Europe/Paris" )
1461
+ ),
1447
1462
deliver_policy = api .DeliverPolicy .BY_START_TIME ,
1448
1463
)
1449
1464
assert isinstance (con .created , datetime .datetime )
1450
- assert con .config .opt_start_time == datetime .datetime (1970 , 1 , 1 , tzinfo = pytz .timezone ("Europe/Paris" ))
1465
+ assert con .config .opt_start_time == datetime .datetime (
1466
+ 1970 , 1 , 1 , tzinfo = pytz .timezone ("Europe/Paris" )
1467
+ )
1451
1468
await nc .close ()
1452
1469
1453
1470
@async_test
@@ -1458,11 +1475,15 @@ async def test_consumer_with_opt_start_time_timestamp_tz(self):
1458
1475
await jsm .add_stream (name = "ctests" , subjects = ["a" , "b" , "c.>" ])
1459
1476
con = await jsm .add_consumer (
1460
1477
"ctests" ,
1461
- opt_start_time = datetime .datetime (1970 , 1 , 1 , 1 , 1 , 1 , tzinfo = pytz .timezone ("Europe/Paris" )),
1478
+ opt_start_time = datetime .datetime (
1479
+ 1970 , 1 , 1 , 1 , 1 , 1 , tzinfo = pytz .timezone ("Europe/Paris" )
1480
+ ),
1462
1481
deliver_policy = api .DeliverPolicy .BY_START_TIME ,
1463
1482
)
1464
1483
assert isinstance (con .created , datetime .datetime )
1465
- assert con .config .opt_start_time == datetime .datetime (1970 , 1 , 1 , 1 , 1 , 1 , tzinfo = pytz .timezone ("Europe/Paris" ))
1484
+ assert con .config .opt_start_time == datetime .datetime (
1485
+ 1970 , 1 , 1 , 1 , 1 , 1 , tzinfo = pytz .timezone ("Europe/Paris" )
1486
+ )
1466
1487
await nc .close ()
1467
1488
1468
1489
@async_test
@@ -1474,30 +1495,44 @@ async def test_consumer_with_opt_start_time_microseconds_tz(self):
1474
1495
con = await jsm .add_consumer (
1475
1496
"ctests" ,
1476
1497
opt_start_time = datetime .datetime (
1477
- 1970 , 1 , 1 , 1 , 1 , 1 , microsecond = 123456 , tzinfo = pytz .timezone ("Europe/Paris" )
1498
+ 1970 ,
1499
+ 1 ,
1500
+ 1 ,
1501
+ 1 ,
1502
+ 1 ,
1503
+ 1 ,
1504
+ microsecond = 123456 ,
1505
+ tzinfo = pytz .timezone ("Europe/Paris" )
1478
1506
),
1479
1507
deliver_policy = api .DeliverPolicy .BY_START_TIME ,
1480
1508
)
1481
1509
assert isinstance (con .created , datetime .datetime )
1482
1510
assert con .config .opt_start_time == datetime .datetime (
1483
- 1970 , 1 , 1 , 1 , 1 , 1 , microsecond = 123456 , tzinfo = pytz .timezone ("Europe/Paris" )
1511
+ 1970 ,
1512
+ 1 ,
1513
+ 1 ,
1514
+ 1 ,
1515
+ 1 ,
1516
+ 1 ,
1517
+ microsecond = 123456 ,
1518
+ tzinfo = pytz .timezone ("Europe/Paris" )
1484
1519
)
1485
1520
await nc .close ()
1486
1521
1487
1522
def test_parser_consumer_info_with_created_timestamp (self ):
1488
1523
for created in [
1489
- "1970-01-01T01:02:03Z" ,
1490
- "1970-01-01T02:02:03+01:00" ,
1491
- "1970-01-01T01:02:03.0Z" ,
1492
- "1970-01-01T01:02:03.00Z" ,
1493
- "1970-01-01T01:02:03.000Z" ,
1494
- "1970-01-01T01:02:03.0000Z" ,
1495
- "1970-01-01T01:02:03.00000Z" ,
1496
- "1970-01-01T01:02:03.000000Z" ,
1497
- "1970-01-01T01:02:03.0000000Z" ,
1498
- "1970-01-01T01:02:03.00000000Z" ,
1499
- "1970-01-01T01:02:03.000000000Z" ,
1500
- "1970-01-01T02:02:03.000000000Z+01:00" ,
1524
+ "1970-01-01T01:02:03Z" ,
1525
+ "1970-01-01T02:02:03+01:00" ,
1526
+ "1970-01-01T01:02:03.0Z" ,
1527
+ "1970-01-01T01:02:03.00Z" ,
1528
+ "1970-01-01T01:02:03.000Z" ,
1529
+ "1970-01-01T01:02:03.0000Z" ,
1530
+ "1970-01-01T01:02:03.00000Z" ,
1531
+ "1970-01-01T01:02:03.000000Z" ,
1532
+ "1970-01-01T01:02:03.0000000Z" ,
1533
+ "1970-01-01T01:02:03.00000000Z" ,
1534
+ "1970-01-01T01:02:03.000000000Z" ,
1535
+ "1970-01-01T02:02:03.000000000Z+01:00" ,
1501
1536
]:
1502
1537
info = api .ConsumerInfo .from_response ({
1503
1538
"name" : "test" ,
@@ -1510,21 +1545,21 @@ def test_parser_consumer_info_with_created_timestamp(self):
1510
1545
1970 , 1 , 1 , 1 , 2 , 3 , tzinfo = datetime .timezone .utc
1511
1546
)
1512
1547
for created in [
1513
- "1970-01-01T01:02:03.4Z" ,
1514
- "1970-01-01T01:02:03.4+00:00" ,
1515
- "1970-01-01T01:02:03.40Z" ,
1516
- "1970-01-01T02:02:03.40+01:00" ,
1517
- "1970-01-01T01:02:03.400Z" ,
1518
- "1970-01-01T04:02:03.400+03:00" ,
1519
- "1970-01-01T01:02:03.4000Z" ,
1520
- "1970-01-01T07:22:03.4000+06:20" ,
1521
- "1970-01-01T01:02:03.40000Z" ,
1522
- "1970-01-01T00:02:03.400000-01:00" ,
1523
- "1970-01-01T01:02:03.400000Z" ,
1524
- "1970-01-01T01:02:03.4000000Z" ,
1525
- "1970-01-01T01:02:03.40000000Z" ,
1526
- "1970-01-01T01:02:03.400000000Z" ,
1527
- "1970-01-01T02:02:03.400000000Z+01:00" ,
1548
+ "1970-01-01T01:02:03.4Z" ,
1549
+ "1970-01-01T01:02:03.4+00:00" ,
1550
+ "1970-01-01T01:02:03.40Z" ,
1551
+ "1970-01-01T02:02:03.40+01:00" ,
1552
+ "1970-01-01T01:02:03.400Z" ,
1553
+ "1970-01-01T04:02:03.400+03:00" ,
1554
+ "1970-01-01T01:02:03.4000Z" ,
1555
+ "1970-01-01T07:22:03.4000+06:20" ,
1556
+ "1970-01-01T01:02:03.40000Z" ,
1557
+ "1970-01-01T00:02:03.400000-01:00" ,
1558
+ "1970-01-01T01:02:03.400000Z" ,
1559
+ "1970-01-01T01:02:03.4000000Z" ,
1560
+ "1970-01-01T01:02:03.40000000Z" ,
1561
+ "1970-01-01T01:02:03.400000000Z" ,
1562
+ "1970-01-01T02:02:03.400000000Z+01:00" ,
1528
1563
]:
1529
1564
info = api .ConsumerInfo .from_response ({
1530
1565
"name" : "test" ,
0 commit comments