Keep test_write_bytes.py source 7-bit ASCII
Use the \u00e9 escape instead of a literal e-acute. The test still exercises multi-byte UTF-8 encoding.pull/70/head
parent
56e3297edd
commit
d55a68d4ab
|
|
@ -78,7 +78,8 @@ def test_write_memoryview_sends_contents(monkeypatch):
|
|||
|
||||
def test_write_str_is_utf8_encoded(monkeypatch):
|
||||
# Backward compatibility: str is UTF-8 encoded (historical t2b()
|
||||
# behavior), not rejected.
|
||||
# behavior), not rejected. The \u00e9 escape keeps the source 7-bit
|
||||
# ASCII while still exercising a multi-byte UTF-8 encoding.
|
||||
sock, lib = _make_socket(monkeypatch)
|
||||
sock.write("héllo")
|
||||
assert lib.written == "héllo".encode("utf-8")
|
||||
sock.write("h\u00e9llo")
|
||||
assert lib.written == "h\u00e9llo".encode("utf-8")
|
||||
|
|
|
|||
Loading…
Reference in New Issue