(length: int, seed_value: int)
| 988 | @pytest.mark.parametrize("length", [0, 1, 7, 64]) |
| 989 | @pytest.mark.parametrize("seed_value", SEED_VALUES) |
| 990 | def test_fill_random_alphabet(length: int, seed_value: int): |
| 991 | |
| 992 | # Same nonce should produce the same result |
| 993 | random_string = sz.random(length, nonce=seed_value) |
| 994 | same_nonce_random_string = sz.random(length, nonce=seed_value) |
| 995 | assert isinstance(random_string, (bytes, bytearray)) |
| 996 | assert len(random_string) == length |
| 997 | assert random_string == same_nonce_random_string |
| 998 | |
| 999 | # With alphabet: all bytes must belong to alphabet |
| 1000 | alphabet = b"0123456789" |
| 1001 | random_digits = sz.random(128, nonce=seed_value, alphabet=alphabet) |
| 1002 | assert set(random_digits).issubset(set(alphabet)) |
| 1003 | |
| 1004 | |
| 1005 | @pytest.mark.parametrize("body", ["", "hello", "world", "abcdefg", "a" * 32]) |
nothing calls this directly
no test coverage detected
searching dependent graphs…