2022-02-11 20:11:22 +00:00
|
|
|
from uuid import UUID
|
|
|
|
|
2021-10-18 09:17:31 +00:00
|
|
|
from sure import assertion
|
2013-07-27 20:24:38 +00:00
|
|
|
|
|
|
|
|
2022-02-11 20:11:22 +00:00
|
|
|
@assertion
|
|
|
|
def match_uuid4(context):
|
|
|
|
try:
|
|
|
|
uuid_obj = UUID(context.obj, version=4)
|
|
|
|
except ValueError:
|
|
|
|
return False
|
|
|
|
return str(uuid_obj) == context.obj
|