Skip to content
Myr

Fixed indenting issues

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 b473440 · Browse files · 1 file+14 added−15 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−15 removed

  • tests:+14 added−15 removed

1 file+14 added−15 removed

modified:tests/testserver/server.py+14 added-15 removed
1import threading 1import threading2import socket3import select45
7 unmodified lines
1314 if not new_content:15 break1617 content += new_content 17 content += new_content18 # stop reading if no new data is received for a while19 more_to_read = select.select([sock], [], [], timeout)[0] 19 more_to_read = select.select([sock], [], [], timeout)[0]2021 return content2223
9 unmodified lines
3334 self.host = host35 self.port = port36 self.requests_to_handle = requests_to_handle37 3738 self.wait_to_close_event = wait_to_close_event39 self.ready_event = threading.Event()40 self.stop_event = threading.Event()41
11 unmodified lines
53 @classmethod54 def basic_response_server(cls, **kwargs):55 return cls.text_response_server(56 "HTTP/1.1 200 OK\r\n" +57 "Content-Length: 0\r\n\r\n", 57 "Content-Length: 0\r\n\r\n",58 **kwargs59 )6061 def run(self):
22 unmodified lines
84 sock = server_sock.accept()[0]85 handler_result = self.handler(sock)8687 self.handler_results.append(handler_result)88 8889 def __enter__(self):90 self.start()91 self.ready_event.wait(self.WAIT_EVENT_TIMEOUT)92 return self.host, self.port93 90 self.start()91 self.ready_event.wait(self.WAIT_EVENT_TIMEOUT)92 return self.host, self.port9394 def __exit__(self, exc_type, exc_value, traceback):95 if exc_type is None:96 self.stop_event.wait(self.WAIT_EVENT_TIMEOUT)97 else:98 if self.wait_to_close_event:99 # avoid server from waiting for event timeouts 100 # if an exception is found in the main thread 101 self.wait_to_close_event.set() 102 return False # allow exceptions to propagate 103 99 # avoid server from waiting for event timeouts100 # if an exception is found in the main thread101 self.wait_to_close_event.set()102 return False # allow exceptions to propagate