def test_build_generic_ok(self): dr = ncore.GenericOk() resp = nhttp.build_response(dr) self.assertEqual(resp.status, 200) self.assertEqual(resp.body, "")
def test_build_node_list(self): d0 = ncore.NodeDescriptor(host_port="localhost:8000") d1 = ncore.NodeDescriptor(host_port="localhost:8001") d2 = ncore.NodeDescriptor(host_port="localhost:8002") dr = ncore.NodeList(nodes=[d0,d1,d2]) resp = nhttp.build_response(dr) self.assertEqual(resp.status, 200) self.assertEqual(resp.body, "localhost:8000\nlocalhost:8001\nlocalhost:8002")