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