Skip to content
Myr

Tested text_response_server

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 3b2a489 · Browse files · 1 file+14 added−0 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+14 added−0 removed

  • other:+14 added−0 removed

1 file+14 added−0 removed

modified:test_requests.py+14 added
1782 unmodified lines
17831784 with pytest.raises(socket.error):1785 new_sock = socket.socket()1786 new_sock.connect((host, port))17871788 def test_text_response(self):1789 server = Server.text_response_server(1790 "HTTP/1.1 200 OK\r\n" + 1791 "Content-Length: 6\r\n" +1792 "\r\nroflol"1793 )17941795 with server as (host, port):1796 r = requests.get('http://{}:{}'.format(host, port))17971798 assert r.status_code == 2001799 assert r.text == 'roflol'1800 assert r.headers['Content-Length'] == '6'1801 1802 def test_basic_response(self):1803 with Server.basic_response_server() as (host, port):1804 r = requests.get('http://{}:{}'.format(host, port))
17 unmodified lines