MCPcopy Create free account
hub / github.com/Azure/azure-storage-python / get_random_text_data

Method get_random_text_data

tests/testcase.py:113–124  ·  view source on GitHub ↗

Returns random unicode text data exceeding the size threshold for chunking blob upload.

(self, size)

Source from the content-addressed store, hash-verified

111 return bytes(result)
112
113 def get_random_text_data(self, size):
114 '''Returns random unicode text data exceeding the size threshold for
115 chunking blob upload.'''
116 checksum = zlib.adler32(self.qualified_test_name.encode()) & 0xffffffff
117 rand = random.Random(checksum)
118 text = u''
119 words = [u'hello', u'world', u'python', u'啊齄丂狛狜']
120 while (len(text) < size):
121 index = int(rand.random()*(len(words) - 1))
122 text = text + u' ' + words[index]
123
124 return text
125
126 @staticmethod
127 def _set_test_proxy(service, settings):

Calls

no outgoing calls

Tested by

no test coverage detected