diff --git a/src/azure_devtools/scenario_tests/base.py b/src/azure_devtools/scenario_tests/base.py index 81d90f9..29c7d29 100644 --- a/src/azure_devtools/scenario_tests/base.py +++ b/src/azure_devtools/scenario_tests/base.py @@ -37,7 +37,10 @@ def create_temp_file(self, size_kb, full_random=False): with open(path, mode='r+b') as f: if full_random: - chunk = os.urandom(1024) + chunk = bytearray("".join(chr(int((126 - 32) \ + * (ord(_) if isinstance(_, str) else _) \ + / 255 + 32)) for _ in os.urandom(1024)), + 'utf-8') else: chunk = bytearray([0] * 1024) for _ in range(size_kb):