Skip to content
Myr

Tested timeouts in text_response_server requests retrieval

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

  • other:+25 added−0 removed

1 file+25 added−0 removed

modified:test_requests.py+25 added
1851 unmodified lines
18521853 assert server.handler_results[0] == first_request1854 assert server.handler_results[1] == second_request18551856 def test_requests_after_timeout_are_not_received(self):1857 server = Server.basic_response_server(request_timeout=1)18581859 with server as address:1860 sock = socket.socket()1861 sock.connect(address)1862 time.sleep(1.5)1863 sock.send(b"hehehe, not received")1864 sock.close()18651866 assert server.handler_results[0] == ""186718681869 def test_request_recovery_with_bigger_timeout(self):1870 server = Server.basic_response_server(request_timeout=3)1871 data = "bananadine"18721873 with server as address:1874 sock = socket.socket() 1875 sock.connect(address)1876 time.sleep(1.5)1877 sock.send(data.encode())1878 sock.close()1879 1880 assert server.handler_results[0] == data18811882if __name__ == '__main__':1883 unittest.main()