add datetable cnfcnpj

This commit is contained in:
2025-11-24 11:45:53 -03:00
parent 5b1ba9e9c7
commit 78ad183e61
29 changed files with 828 additions and 255 deletions

View File

@@ -1,6 +1,7 @@
from datetime import datetime
from decimal import Decimal
from ipaddress import IPv4Address
from uuid import UUID
import pytest
from layercake.dateutils import ttl
@@ -68,6 +69,22 @@ def test_serialize():
}
def test_serialize_uuid():
uuid = UUID('12345678-1234-5678-1234-567812345678')
assert serialize({'id': uuid}) == {
'id': {'S': '12345678-1234-5678-1234-567812345678'}
}
def test_serialize_pairs():
pairs = [(1, 2), (3, 4), (5, 6)]
expected = serialize({'pairs': pairs})
assert expected == {
'pairs': {'L': [{'NS': ['1', '2']}, {'NS': ['3', '4']}, {'NS': ['5', '6']}]}
}
def test_composekey():
key = ComposeKey(('122', 'abc'), prefix='schedules', delimiter=':')
assert key == 'schedules:122:abc'