Skip to content

Commit d459d46

Browse files
committed
Progress towards validation
1 parent 8e4c39a commit d459d46

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/mock_vws/_validators.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -452,6 +452,16 @@ def validate_name(
452452
}
453453
return json_dump(body)
454454

455+
try:
456+
name.encode('ascii')
457+
except UnicodeEncodeError:
458+
context.status_code = codes.INTERNAL_SERVER_ERROR
459+
body = {
460+
'transaction_id': uuid.uuid4().hex,
461+
'result_code': ResultCodes.FAIL.value,
462+
}
463+
return json_dump(body)
464+
455465

456466
return wrapped(*args, **kwargs)
457467

0 commit comments

Comments
 (0)