def test_005_create_gmo_from_xml(): xml_str = ''' <faultInst descr="TCA: etherTxStats totalBytesDelta = 1005, raised above 0" dn="sys/chassis-1/slot-1/host/port-2/fault-F35275" status="modified"/> ''' gmo = ucsmo.generic_mo_from_xml(xml_str) xml_element = gmo.to_xml() to_xml_str = xc.to_xml_str(xml_element)
def test_006_gmo_to_mo(): xml_str = ''' <faultInst descr="TCA: etherTxStats totalBytesDelta = 1005, raised above 0" dn="sys/chassis-1/slot-1/host/port-2/fault-F35275" status="modified"/> ''' gmo = ucsmo.generic_mo_from_xml(xml_str) mo = gmo.to_mo() assert_equal(mo.code, "F35275")