tests/utils/gen_fuzz_strings.py
raw| 1 | from itertools import product |
| 2 | from typing import Generator |
| 3 | |
| 4 | __all__ = ["gen_fuzz_strings"] |
| 5 | |
| 6 | |
| 7 | def gen_fuzz_strings(allowed_chars: str, max_length: int) -> Generator[str, None, None]: |
| 8 | """Generator that produces all possible combinations of allowed characters.""" |
| 9 | for length in range(max_length + 1): |
| 10 | yield from map("".join, product(allowed_chars, repeat=length)) |