64
62
# Test both case squashing and length restriction
65
63
fid = gen_file_id('A'*50 + '.txt')
66
64
self.assertStartsWith(fid, 'a'*20 + '-')
69
67
# restricting length happens after the other actions, so
70
68
# we preserve as much as possible
71
69
fid = gen_file_id('\xe5\xb5..aBcd\tefGhijKLMnop\tqrstuvwxyz')
72
70
self.assertStartsWith(fid, 'abcdefghijklmnopqrst-')
75
73
def test_file_ids_are_ascii(self):
76
74
tail = r'-\d{14}-[a-z0-9]{16}-\d+'