Example #1
0
 def test_with_application_defined_and_text(self):
     appcond = etree.Element("{uri:bar}value-error")
     self.assertEqual(
         "{uri:foo}error/{uri:bar}value-error ('that’s not an integer')",
         errors.format_error_text(condition=("uri:foo", "error"),
                                  application_defined_condition=appcond,
                                  text="that’s not an integer"))
Example #2
0
 def test_with_application_defined(self):
     appcond = etree.Element("{uri:bar}value-error")
     self.assertEqual(
         "{uri:foo}error/{uri:bar}value-error",
         errors.format_error_text(
             condition=("uri:foo", "error"),
             application_defined_condition=appcond,
         ))
Example #3
0
    def _send_xso(self, obj):
        self._tester.assertTrue(
            self._actions,
            self._format_unexpected_action("send_xso(" + repr(obj) + ")",
                                           "no actions left"))
        head = self._actions[0]
        self._tester.assertIsInstance(
            head, self.Send,
            self._format_unexpected_action("send_xso",
                                           "expected something different"))

        t1 = etree.Element("root")
        obj.unparse_to_node(t1)
        t2 = etree.Element("root")
        head.obj.unparse_to_node(t2)

        self._tester.assertSubtreeEqual(t1, t2)
        self._actions.pop(0)
        self._execute_response(head.response)