Exemplo n.º 1
0
 def test_unmatched(self):
     """
     `ServiceExceptionDetail.from_element` returns ``None`` if the element's
     tag is not a service exception detail.
     """
     elem = L.WhatIsThis(L.foo('a'), L.bar('b'))
     self.assertIdentical(None, ServiceExceptionDetail.from_element(elem))
Exemplo n.º 2
0
 def test_from_element(self):
     """
     `ServiceExceptionDetail.from_element` returns
     a `ServiceExceptionDetail` instance by parsing
     a ``ServiceExceptionDetail`` detail element.
     """
     elem = PARLAYX_COMMON_NS.ServiceExceptionDetail(
         L.messageId('a'), L.text('b'), L.variables('c'), L.variables('d'))
     detail = ServiceExceptionDetail.from_element(elem)
     self.assertEqual(('a', 'b', ['c', 'd']),
                      (detail.message_id, detail.text, detail.variables))