Unit test for the expected behavior to obtain ids for parametrized bytes values: bytes objects are always escaped using "binary escape".
(self)
| 399 | assert actual == expected |
| 400 | |
| 401 | def test_bytes_idval(self) -> None: |
| 402 | """Unit test for the expected behavior to obtain ids for parametrized |
| 403 | bytes values: bytes objects are always escaped using "binary escape".""" |
| 404 | values = [ |
| 405 | (b"", r""), |
| 406 | (b"\xc3\xb4\xff\xe4", r"\xc3\xb4\xff\xe4"), |
| 407 | (b"ascii", r"ascii"), |
| 408 | ("αρά".encode(), r"\xce\xb1\xcf\x81\xce\xac"), |
| 409 | ] |
| 410 | for val, expected in values: |
| 411 | assert ( |
| 412 | IdMaker([], [], None, None, None, None)._idval(val, "a", 6) == expected |
| 413 | ) |
| 414 | |
| 415 | def test_class_or_function_idval(self) -> None: |
| 416 | """Unit test for the expected behavior to obtain ids for parametrized |