nwaku/tests/waku_archive/test_partition_manager.nim
Ivan FB 24661ea969
postgres partitions: ensure the partition ranges are o'clock (#2776)
Also, skip the error "partition already exists" because that happens
when multiple nodes interact with the same database.
2024-06-05 17:45:38 +02:00

17 lines
614 B
Nim

{.used.}
import testutils/unittests, chronos
import
../../../waku/waku_archive/driver/postgres_driver/partitions_manager,
../../../waku/waku_core/time
suite "Partition Manager":
test "Calculate end partition time":
# 1717372850 == Mon Jun 03 2024 00:00:50 GMT+0000
# 1717376400 == Mon Jun 03 2024 01:00:00 GMT+0000
check 1717376400 == partitions_manager.calcEndPartitionTime(Timestamp(1717372850))
# 1717372800 == Mon Jun 03 2024 00:00:00 GMT+0000
# 1717376400 == Mon Jun 03 2024 01:00:00 GMT+0000
check 1717376400 == partitions_manager.calcEndPartitionTime(Timestamp(1717372800))