diff options
Diffstat (limited to 'pyuno/qa/pytests/testcollections_XNameAccess.py')
-rw-r--r-- | pyuno/qa/pytests/testcollections_XNameAccess.py | 25 |
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) |