summaryrefslogtreecommitdiff
path: root/pyuno
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2023-05-30 14:09:25 +0200
committerSzymon Kłos <szymon.klos@collabora.com>2023-07-12 07:56:37 +0200
commite78f60a369146774ca2a38ca121f294b562b2be5 (patch)
tree46eb6ec25611b03400c46cf089c7fa28563d6d5a /pyuno
parent43c564da59d7d951ee9a903b80e82fd1159d0c71 (diff)
Categories for link targets in Impress
Writer and Calc presented possible link targets inside documents as a Tree, with items under their categories. This patch makes the same for Impress so we don't mix master pages with regular pages. Change-Id: Ifd98300b0d609c28d6c1880332fff7e750b5e1b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152389 Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153985 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Diffstat (limited to 'pyuno')
-rw-r--r--pyuno/qa/pytests/testcollections_XNameAccess.py25
1 files changed, 14 insertions, 11 deletions
diff --git a/pyuno/qa/pytests/testcollections_XNameAccess.py b/pyuno/qa/pytests/testcollections_XNameAccess.py
index 79d66a2e1bc2..5c5ad6890be2 100644
--- a/pyuno/qa/pytests/testcollections_XNameAccess.py
+++ b/pyuno/qa/pytests/testcollections_XNameAccess.py
@@ -28,10 +28,14 @@ class TestXNameAccess(CollectionsTestBase):
drw = self.createBlankDrawing()
# When
- length = len(drw.Links)
+ length_categories = len(drw.Links)
+ length_slides = len(drw.Links['Slide'].Links)
+ length_master = len(drw.Links['Master Page'].Links)
# Then
- self.assertEqual(2, length)
+ self.assertEqual(4, length_categories)
+ self.assertEqual(1, length_slides)
+ self.assertEqual(1, length_master)
drw.close(True)
@@ -45,7 +49,7 @@ class TestXNameAccess(CollectionsTestBase):
drw.DrawPages[0].Name = 'foo'
# When
- link = drw.Links['foo']
+ link = drw.Links['Slide'].Links['foo']
# Then
self.assertEqual('foo', link.getName())
@@ -62,7 +66,7 @@ class TestXNameAccess(CollectionsTestBase):
# When / Then
with self.assertRaises(KeyError):
- link = drw.Links['foo']
+ link = drw.Links['Slide'].Links['foo']
drw.close(True)
@@ -146,7 +150,7 @@ class TestXNameAccess(CollectionsTestBase):
drw.DrawPages[0].Name = 'foo'
# When
- present = 'foo' in drw.Links
+ present = 'foo' in drw.Links['Slide'].Links
# Then
self.assertTrue(present)
@@ -161,17 +165,17 @@ class TestXNameAccess(CollectionsTestBase):
# Given
drw = self.createBlankDrawing()
i = 0
- for name in drw.Links.getElementNames():
- drw.Links.getByName(name).Name = 'foo' + str(i)
+ for name in drw.Links['Slide'].Links.getElementNames():
+ drw.Links['Slide'].Links.getByName(name).Name = 'foo' + str(i)
i += 1
# When
read_links = []
- for link in drw.Links:
+ for link in drw.Links['Slide'].Links:
read_links.append(link)
# Then
- self.assertEqual(['foo0', 'foo1'], read_links)
+ self.assertEqual(['foo0'], read_links)
drw.close(True)
@@ -184,11 +188,10 @@ class TestXNameAccess(CollectionsTestBase):
drw = self.createBlankDrawing()
# When
- itr = iter(drw.Links)
+ itr = iter(drw.Links['Slide'].Links)
# Then
self.assertIsNotNone(next(itr))
- self.assertIsNotNone(next(itr))
with self.assertRaises(StopIteration):
next(itr)