@@ -149,15 +149,17 @@ def test_ulid_from_timestamp() -> None:
149149@pytest .mark .parametrize (
150150 ("constructor" , "value" ),
151151 [
152- (ULID , b"sdf" ),
153- (ULID .from_timestamp , b"not-a-timestamp" ),
154- (ULID .from_datetime , time .time ()),
155- (ULID .from_bytes , b"not-enough" ),
156- (ULID .from_bytes , 123 ),
157- (ULID .from_str , "not-enough" ),
158- (ULID .from_str , 123 ),
159- (ULID .from_int , "not-an-int" ),
160- (ULID .from_uuid , "not-a-uuid" ),
152+ (ULID , b"sdf" ), # invalid length
153+ (ULID .from_timestamp , b"not-a-timestamp" ), # invalid type
154+ (ULID .from_datetime , time .time ()), # invalid type
155+ (ULID .from_bytes , b"not-enough" ), # invalid length
156+ (ULID .from_bytes , 123 ), # invalid type
157+ (ULID .from_str , "not-enough" ), # invalid length
158+ (ULID .from_str , 123 ), # inavlid type
159+ (ULID .from_str , "notavalidulidnotavalidulid" ), # invalid alphabet
160+ (ULID .from_str , "Z" * 26 ), # invalid timestamp
161+ (ULID .from_int , "not-an-int" ), # invalid type
162+ (ULID .from_uuid , "not-a-uuid" ), # invalid type
161163 ],
162164)
163165def test_ulid_invalid_input (constructor : Callable [[Params ], ULID ], value : Params ) -> None :
0 commit comments