diff options
author | jmzambon <jeanmarczambon@gmail.com> | 2017-07-18 18:08:46 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-08-01 16:57:18 +0200 |
commit | 51dee24ce82e0fc4b864ac2905ce3587acf344f3 (patch) | |
tree | 4ac69b96fa00b9c08a5791b39759495b841e6f44 /sw/qa/python | |
parent | EPUB export: invoke the underlying ODT exporter (diff) | |
download | core-51dee24ce82e0fc4b864ac2905ce3587acf344f3.tar.gz core-51dee24ce82e0fc4b864ac2905ce3587acf344f3.zip |
tdf#97362: TextPortionEnumerationTest partially migrated to python (part 4)
Convert tests:
- test_end1
- test_end2
- test_end3
- test_end4
- test_end5
- test_empty1
- test_empty2
- test_empty3
- test1
Change-Id: Id21f94be9c5c36e72a25409ed8541908671fdb59
Reviewed-on: https://gerrit.libreoffice.org/40149
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sw/qa/python')
-rw-r--r-- | sw/qa/python/text_portion_enumeration_test.py | 137 |
1 files changed, 137 insertions, 0 deletions
diff --git a/sw/qa/python/text_portion_enumeration_test.py b/sw/qa/python/text_portion_enumeration_test.py index 7251efe6d27a..407b96218bd9 100644 --- a/sw/qa/python/text_portion_enumeration_test.py +++ b/sw/qa/python/text_portion_enumeration_test.py @@ -1336,6 +1336,143 @@ class TextPortionEnumerationTest(unittest.TestCase): root.appendchild(href) self.dotest(root) + def test_end1(self): + name1 = self.mkname("bookmark") + name2 = self.mkname("toxmark") + name3 = self.mkname("refmark") + root = TreeNode() + root.appendchild(TextNode("abc")) + root.appendchild(BookmarkNode(name1)) + root.appendchild(DocumentIndexMarkNode(name2)) + root.appendchild(ReferenceMarkNode(name3)) + self.dotest(root) + + def test_end2(self): + name1 = self.mkname("bookmark") + name2 = self.mkname("frame") + name3 = self.mkname("refmark") + name4 = self.mkname("frame") + name5 = self.mkname("frame") + root = TreeNode() + root.appendchild(TextNode("abc")) + root.appendchild(BookmarkNode(name1)) + root.appendchild(FrameNode(name2, AT_CHARACTER)) + root.appendchild(ReferenceMarkNode(name3)) + root.appendchild(FrameNode(name4, AT_CHARACTER)) + root.appendchild(FrameNode(name5, AT_CHARACTER)) + self.dotest(root) + + def test_end3(self): + name1 = self.mkname("ftn") + name2 = self.mkname("toxmark") + root = TreeNode() + root.appendchild(TextNode("abc")) + root.appendchild(FootnoteNode(name1)) + root.appendchild(DocumentIndexMarkNode(name2)) + self.dotest(root) + + def test_end4(self): + name1 = self.mkname("bookmark") + name2 = self.mkname("frame") + root = TreeNode() + root.appendchild(BookmarkStartNode(name1)) + root.appendchild(TextNode("abc")) + root.appendchild(FrameNode(name2, AS_CHARACTER)) + root.appendchild(BookmarkEndNode(name1)) + self.dotest(root) + + def test_end5(self): + name1 = self.mkname("refmark") + name2 = self.mkname("ruby") + root = TreeNode() + root.appendchild(ReferenceMarkStartNode(name1)) + root.appendchild(TextNode("abc")) + ruby = RubyNode(name2) + ruby.appendchild(TextFieldNode("de")) + root.appendchild(ruby) + root.appendchild(ReferenceMarkEndNode(name1)) + self.dotest(root) + + def test_empty1(self): + name1 = self.mkname("refmark") + name2 = self.mkname("toxmark") + name3 = self.mkname("bookmark") + name4 = self.mkname("frame") + name7 = self.mkname("refmark") + name8 = self.mkname("toxmark") + name9 = self.mkname("bookmark") + nameA = self.mkname("frame") + root = TreeNode() + root.appendchild(ReferenceMarkNode(name1)) + root.appendchild(DocumentIndexMarkNode(name2)) + root.appendchild(BookmarkNode(name3)) + root.appendchild(FrameNode(name4, AT_CHARACTER)) + root.appendchild(ReferenceMarkNode(name7)) + root.appendchild(DocumentIndexMarkNode(name8)) + root.appendchild(BookmarkNode(name9)) + root.appendchild(FrameNode(nameA, AT_CHARACTER)) + self.dotest(root) + + def test_empty2(self): + name3 = self.mkname("bookmark") + name4 = self.mkname("frame") + name9 = self.mkname("bookmark") + nameA = self.mkname("frame") + root = TreeNode() + root.appendchild(BookmarkNode(name3)) + root.appendchild(FrameNode(name4, AT_CHARACTER)) + root.appendchild(BookmarkNode(name9)) + root.appendchild(FrameNode(nameA, AT_CHARACTER)) + self.dotest(root) + + def test_empty3(self): + name1 = self.mkname("refmark") + name2 = self.mkname("toxmark") + name3 = self.mkname("bookmark") + name4 = self.mkname("frame") + name5 = self.mkname("url") + name6 = self.mkname("ruby") + name7 = self.mkname("refmark") + name8 = self.mkname("toxmark") + name9 = self.mkname("bookmark") + nameA = self.mkname("frame") + root = TreeNode() + root.appendchild(ReferenceMarkNode(name1)) + root.appendchild(DocumentIndexMarkNode(name2)) + root.appendchild(BookmarkNode(name3)) + root.appendchild(FrameNode(name4, AT_CHARACTER)) + ## currently empty hyperlinks may get eaten... + # href = HyperlinkNode(name5) + # href.appendchild(TextNode("")) + # root.appendchild(href) + ruby = RubyNode(name6) + root.appendchild(ruby) + root.appendchild(ReferenceMarkNode(name7)) + root.appendchild(DocumentIndexMarkNode(name8)) + root.appendchild(BookmarkNode(name9)) + root.appendchild(FrameNode(nameA, AT_CHARACTER)) + self.dotest(root) + + def test1(self): + name1 = self.mkname("frame") + name2 = self.mkname("bookmark") + name3 = self.mkname("ruby") + name4 = self.mkname("ftn") + name5 = self.mkname("frame") + root = TreeNode() + root.appendchild(FrameNode(name1, AT_CHARACTER)) + root.appendchild(BookmarkStartNode(name2)) + root.appendchild(TextNode("abc")) + ruby = RubyNode(name3) + ruby.appendchild(TextNode("de")) + ruby.appendchild(FootnoteNode(name4)) + ruby.appendchild(BookmarkEndNode(name2)) + root.appendchild(ruby) + root.appendchild(TextNode("fg")) + root.appendchild(FrameNode(name5, AT_CHARACTER)) + root.appendchild(TextFieldNode("h")) + self.dotest(root) + def dotest(self, intree, insert=True): xDoc = self.__class__.xDoc self._dotest(xDoc, intree, insert) |