Ejemplo n.º 1
0
def test_idempotency():
    ulid = ULID()
    assert ULID.from_bytes(ulid.bytes) == ulid
    assert ULID.from_str(str(ulid)) == ulid
    assert ULID.from_uuid(ulid.to_uuid()) == ulid
    assert ULID.from_int(int(ulid)) == ulid
    assert ULID.from_hex(ulid.hex) == ulid
Ejemplo n.º 2
0
 def ulid(self):
     return ULID.from_str(self.id)