def test_conversion_rpc_to_xml_output_1(self): self.maxDiff = None xml = _collapse_string(''' <?xml version="1.0" encoding="UTF-8"?>\n<rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:0fc67048-93c4-11e5-bfc9-fa163e622f12" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"><out1 xmlns="http://riftio.com/ns/riftware-1.0/rw-restconf">hello</out1>\n<out2 xmlns="http://riftio.com/ns/riftware-1.0/rw-restconf">world</out2>\n</rpc-reply> ''') expected_xml = _collapse_string(''' <output><out1 xmlns="http://riftio.com/ns/riftware-1.0/rw-restconf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">hello</out1><out2 xmlns="http://riftio.com/ns/riftware-1.0/rw-restconf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">world</out2></output> ''') actual_xml = convert_rpc_to_xml_output(xml) self.assertEqual(actual_xml, expected_xml)
def test_conversion_rpc_to_xml_output(self): self.maxDiff = None xml = _collapse_string(''' <?xml version="1.0" encoding="UTF-8"?> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="urn:uuid:0ba69bd8-938c-11e5-a933-fa163e622f12" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <out xmlns="http://riftio.com/ns/riftware-1.0/rw-restconf">true</out> </rpc-reply> ''') expected_xml = _collapse_string(''' <output><out xmlns="http://riftio.com/ns/riftware-1.0/rw-restconf" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0">true</out></output> ''') actual_xml = convert_rpc_to_xml_output(xml) self.assertEqual(actual_xml, expected_xml)