Skip to content
Myr

Compare response bodies with unicode strings

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Braulio Valdivielso Martínez · committed by Braulio Valdivielso Martínez · parent 7088c06 · Browse files · 1 file+3 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+3 added−3 removed

  • tests:+3 added−3 removed

1 file+3 added−3 removed

modified:tests/test_testserver.py+3 added-3 removed
43 unmodified lines
44 with server as (host, port):45 r = requests.get('http://{0}:{1}'.format(host, port))4647 assert r.status_code == 20048 assert r.text == 'roflol'48 assert r.text == u'roflol'49 assert r.headers['Content-Length'] == '6' 50 51 def test_basic_response(self):52 with Server.basic_response_server() as (host, port):53 r = requests.get('http://{0}:{1}'.format(host, port))54 assert r.status_code == 20055 assert r.text == ''55 assert r.text == u''56 assert r.headers['Content-Length'] == '0'5758 def test_basic_waiting_server(self):59 block_server = threading.Event()
50 unmodified lines
110 time.sleep(1.5)111 sock.sendall(b"hehehe, not received")112 sock.close()113114 assert server.handler_results[0] == ""114 assert server.handler_results[0] == ''115116117 def test_request_recovery_with_bigger_timeout(self):118 server = Server.basic_response_server(request_timeout=3)
10 unmodified lines