fix test_nulls

This commit is contained in:
Victor Shyba 2020-09-23 02:21:30 -03:00 committed by Lex Berezhny
parent 0a2c161ace
commit 24386c74f4

View file

@ -17,7 +17,8 @@ FILES = [
def make_short_url(r):
try:
# fixme: we describe it as normalized but the old SDK didnt do that
return f'{r["name"].decode()}#{r["shortestID"] or r["claimID"][::-1].hex()[0]}'
name = r["name"].decode().replace("\x00", "")
return f'{name}#{r["shortestID"] or r["claimID"][::-1].hex()[0]}'
except UnicodeDecodeError:
# print(f'failed making short url due to name parse error for claim_id: {r["claimID"][::-1].hex()}')
return "INVALID NAME"