Ejemplo n.º 1
0
    def test_deserialize(self):
        node = test_utils.create_node_from_file('order_contacts.xml')

        contacts = OrderContacts.deserialize(node)

        assert contacts.admin, ContactInfo
        assert contacts.tech, ContactInfo
        assert contacts.billing, ContactInfo
Ejemplo n.º 2
0
    def test_deserialize(self):
        node = test_utils.create_node_from_file('order_contacts.xml')

        contacts = OrderContacts.deserialize(node)

        assert contacts.admin, ContactInfo
        assert contacts.tech, ContactInfo
        assert contacts.billing, ContactInfo
Ejemplo n.º 3
0
 def __init__(self):
     self.status_code = ''
     self.status_message = ''
     self.certificates = None
     self.organization_info = OrganizationInfo()
     self.organization_contacts = OrderContacts()
     self.modified_events = ModificationEvents()
     self.vulnerabilities = Vulnerabilities()
     self.approver_email = ''
Ejemplo n.º 4
0
    def deserialize(cls, xml_node):
        """Deserializes the order detail section in response.

        :param xml_node: XML node to be parsed. Expected to explicitly be
        Order Detail XML node.
        :return: parsed order detail response.
        """
        od = OrderDetail()

        od.status_code = utils.get_element_text(
            xml_node.find('.//m:OrderStatusMinorCode', utils.NS)
        )
        od.status_name = utils.get_element_text(
            xml_node.find('.//m:OrderStatusMinorName', utils.NS)
        )
        od.approver_email = utils.get_element_text(
            xml_node.find('.//m:ApproverEmailAddress', utils.NS)
        )

        # Deserialize Child nodes
        org_info_node = xml_node.find('.//m:OrganizationInfo', utils.NS)
        org_contacts_node = xml_node.find('.//m:OrderContacts', utils.NS)
        od.organization_info = OrganizationInfo.deserialize(org_info_node)
        od.organization_contacts = OrderContacts.deserialize(org_contacts_node)

        mod_events_node = xml_node.find('.//m:ModificationEvents', utils.NS)
        if mod_events_node is not None:
            od.modified_events = (
                ModificationEvents.deserialize(mod_events_node)
            )

        vulnerability_node = xml_node.find('.//m:Vulnerabilities', utils.NS)
        if vulnerability_node is not None:
            od.vulnerabilities = (
                Vulnerabilities.deserialize(vulnerability_node)
            )

        fulfillment_node = xml_node.find('.//m:Fulfillment', utils.NS)
        if fulfillment_node is not None:
            od.certificates = Certificate.deserialize(fulfillment_node)

        return od