|
10 | 10 | import warnings
|
11 | 11 | import tarantool
|
12 | 12 | import pandas
|
| 13 | +import pytz |
13 | 14 |
|
14 | 15 | from tarantool.msgpack_ext_types.packer import default as packer_default
|
15 | 16 | from tarantool.msgpack_ext_types.unpacker import ext_hook as unpacker_ext_hook
|
@@ -544,6 +545,29 @@ def test_UUID_tarantool_encode(self):
|
544 | 545 | 'tarantool': r"datetime.new({year=2022, month=8, day=31, hour=18, min=7, sec=54, " +
|
545 | 546 | r"nsec=308543321})",
|
546 | 547 | },
|
| 548 | + { |
| 549 | + 'python': pandas.Timestamp(year=2022, month=8, day=31, hour=18, minute=7, second=54, |
| 550 | + microsecond=308543, nanosecond=321), |
| 551 | + 'msgpack': (b'\x7a\xa3\x0f\x63\x00\x00\x00\x00\x59\xff\x63\x12\x00\x00\x00\x00'), |
| 552 | + 'tarantool': r"datetime.new({year=2022, month=8, day=31, hour=18, min=7, sec=54, " + |
| 553 | + r"nsec=308543321})", |
| 554 | + }, |
| 555 | + { |
| 556 | + 'python': pandas.Timestamp(year=2022, month=8, day=31, hour=18, minute=7, second=54, |
| 557 | + microsecond=308543, nanosecond=321, |
| 558 | + tzinfo=pytz.FixedOffset(180)), |
| 559 | + 'msgpack': (b'\x4a\x79\x0f\x63\x00\x00\x00\x00\x59\xff\x63\x12\xb4\x00\x00\x00'), |
| 560 | + 'tarantool': r"datetime.new({year=2022, month=8, day=31, hour=18, min=7, sec=54, " + |
| 561 | + r"nsec=308543321, tzoffset=180})", |
| 562 | + }, |
| 563 | + { |
| 564 | + 'python': pandas.Timestamp(year=2022, month=8, day=31, hour=18, minute=7, second=54, |
| 565 | + microsecond=308543, nanosecond=321, |
| 566 | + tzinfo=pytz.FixedOffset(-60)), |
| 567 | + 'msgpack': (b'\x8a\xb1\x0f\x63\x00\x00\x00\x00\x59\xff\x63\x12\xc4\xff\x00\x00'), |
| 568 | + 'tarantool': r"datetime.new({year=2022, month=8, day=31, hour=18, min=7, sec=54, " + |
| 569 | + r"nsec=308543321, tzoffset=-60})", |
| 570 | + }, |
547 | 571 | ]
|
548 | 572 |
|
549 | 573 | def test_datetime_msgpack_decode(self):
|
|
0 commit comments