2 from http.server
import HTTPServer, BaseHTTPRequestHandler
8 """ mock server for unittest 10 Parameter Server API: http://wiki.ros.org/ROS/Parameter%20Server%20API 11 Master Slave APIs: http://wiki.ros.org/ROS/Master_Slave_APIs 14 self.send_response(200)
15 self.send_header(
"Content-type",
"application/xml")
17 body =
"""<?xml version="1.0"?> 20 <param><value><int>-1</int></value></param> 21 <param><value><string>this is a dummy error response</string></value></param> 22 <param><value><int>0</int></value></param> 25 self.wfile.write(body.encode())
28 @pytest.fixture(scope=
"session", autouse=
True)
30 server_address = (
'', 11311)
31 httpd = HTTPServer(server_address, ParameterServerMock)
32 thread = threading.Thread(target=httpd.serve_forever)
def run_mock_parameter_server(request)