(string)
| 16 | |
| 17 | @pytest.mark.parametrize("string", TEST_STRINGS) |
| 18 | def test_guess_bytes(string): |
| 19 | for encoding in TEST_ENCODINGS: |
| 20 | result_str, result_encoding = guess_bytes(string.encode(encoding)) |
| 21 | assert result_str == string |
| 22 | assert result_encoding == encoding |
| 23 | |
| 24 | if "\n" in string: |
| 25 | old_mac_bytes = string.replace("\n", "\r").encode("macroman") |
| 26 | result_str, result_encoding = guess_bytes(old_mac_bytes) |
| 27 | assert result_str == string.replace("\n", "\r") |
| 28 | |
| 29 | |
| 30 | def test_guess_bytes_null(): |
nothing calls this directly
no test coverage detected