From a9e4e7041a338327f1624b7969e017365e06be2d Mon Sep 17 00:00:00 2001 From: Hod Bin Noon Date: Tue, 17 Mar 2020 15:13:33 -0700 Subject: [PATCH] fix bytes/str bug in tests --- tests/test_lowlevel.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test_lowlevel.py b/tests/test_lowlevel.py index b98c2d6260..ddaae3116f 100644 --- a/tests/test_lowlevel.py +++ b/tests/test_lowlevel.py @@ -32,10 +32,11 @@ def test_chunked_upload_uses_only_the_specified_host_header(): text_200 = (b'HTTP/1.1 200 OK\r\n' b'Content-Length: 0\r\n\r\n') correct_host = 'sample-host' + expected_host_header = b'Host: sample-host' def single_host_header_response_handler(sock): request_content = consume_socket_content(sock, timeout=0.5) - assert 'Host: {}'.format(correct_host) in request_content - assert request_content.count('Host: ') == 1 + assert expected_host_header in request_content + assert request_content.count(b'Host: ') == 1 sock.send(text_200) return request_content @@ -50,8 +51,6 @@ def single_host_header_response_handler(sock): close_server.set() # release server block assert r.status_code == 200 - assert r.request.headers['Transfer-Encoding'] == 'chunked' - assert r.request.headers['Host'] == correct_host def test_digestauth_401_count_reset_on_redirect():