Exemplo n.º 1
0
    def test_checker_epilogue_error(self):
        body = etree.Element(CN('office:text'))
        body.append(etree.Element(CN('table:dde-links')))
        body.append(etree.Element(CN('text:p')))

        result = StreamTextBodyChecker.is_valid(body)
        self.assertFalse(result)
Exemplo n.º 2
0
    def test_checker_prelude_error(self):
        body = etree.Element(CN('office:text'))
        body.append(etree.Element(CN('text:p')))
        body.append(etree.Element(CN('text:user-field-decls')))

        result = StreamTextBodyChecker.is_valid(body)
        self.assertFalse(result)
Exemplo n.º 3
0
    def test_checker_prelude_error(self):
        body = etree.Element(CN('office:text'))
        body.append(etree.Element(CN('text:p')))
        body.append(etree.Element(CN('text:user-field-decls')))

        result = StreamTextBodyChecker.is_valid(body)
        self.assertFalse(result)
Exemplo n.º 4
0
    def test_checker_epilogue_error(self):
        body = etree.Element(CN('office:text'))
        body.append(etree.Element(CN('table:dde-links')))
        body.append(etree.Element(CN('text:p')))

        result = StreamTextBodyChecker.is_valid(body)
        self.assertFalse(result)
Exemplo n.º 5
0
 def test_append_text_without_epilogue(self):
     body = TextBody()
     body.append(ODFContentMock(CN("text:p")))
     body.append(ODFContentMock(CN("text:h")))
     result = StreamTextBodyChecker.is_valid(body.xmlnode)
     self.assertTrue(result)
     self.assertEqual(body[0].kind, "Paragraph")
     self.assertEqual(body[1].kind, "Heading")
Exemplo n.º 6
0
 def test_append_text_without_epilogue(self):
     body = TextBody()
     body.append(ODFContentMock(CN("text:p")))
     body.append(ODFContentMock(CN("text:h")))
     result = StreamTextBodyChecker.is_valid(body.xmlnode)
     self.assertTrue(result)
     self.assertEqual(body[2].kind, "Paragraph")
     self.assertEqual(body[3].kind, "Heading")
Exemplo n.º 7
0
 def test_empty_body(self):
     result = StreamTextBodyChecker.is_valid(self.body.xmlnode)
     self.assertTrue(result)
Exemplo n.º 8
0
 def test_empty_body(self):
     result = StreamTextBodyChecker.is_valid(self.body.xmlnode)
     self.assertTrue(result)