class TestServer(object): def start(self): server_address = ('', 8000) self.server = HTTPServer(server_address, Handler) self.thread = Thread(target=self.server.serve_forever, args=[0.01]) self.thread.setDaemon(True) self.thread.start() def stop(self): self.server.shutdown() self.thread.join() self.server.server_close()
def start(self): server_address = ('', 8000) self.server = HTTPServer(server_address, Handler) self.thread = Thread(target=self.server.serve_forever, args=[0.01]) self.thread.setDaemon(True) self.thread.start()