Skip to content

Commit 7382533

Browse files
committed
Add UUID=>ULID test
1 parent 6b6c283 commit 7382533

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/test_ulid.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import uuid
12
from datetime import datetime, timezone
23
from typing import Any
34

@@ -27,6 +28,9 @@ class Something(BaseModel):
2728
# Invalid ULID for str format
2829
('01BTGNYV6HRNK8K8VKZASZCFP', None, False), # Invalid ULID (short length)
2930
('01BTGNYV6HRNK8K8VKZASZCFPEA', None, False), # Invalid ULID (long length)
31+
# Valid ULID for UUID format
32+
(uuid.UUID('0196FEB3-9C99-8D8C-B3F3-4301C5E9DCE1'), '01JVZB774SHP6B7WT3072YKQ71', True),
33+
(uuid.UUID('0196FEB3-CD14-4B50-0015-C1E09BF7B221'), '01JVZB7K8M9D8005E1W2DZFCH1', True),
3034
# Valid ULID for _ULID format
3135
(_ULID.from_str('01BTGNYV6HRNK8K8VKZASZCFPE'), '01BTGNYV6HRNK8K8VKZASZCFPE', True),
3236
(_ULID.from_str('01BTGNYV6HRNK8K8VKZASZCFPF'), '01BTGNYV6HRNK8K8VKZASZCFPF', True),

0 commit comments

Comments
 (0)