summaryrefslogtreecommitdiffstats
path: root/pyuno/qa/pytests/testcollections_XIndexAccess.py
diff options
context:
space:
mode:
Diffstat (limited to 'pyuno/qa/pytests/testcollections_XIndexAccess.py')
-rw-r--r--pyuno/qa/pytests/testcollections_XIndexAccess.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/pyuno/qa/pytests/testcollections_XIndexAccess.py b/pyuno/qa/pytests/testcollections_XIndexAccess.py
index 4631ca3706ed..7228ed87336b 100644
--- a/pyuno/qa/pytests/testcollections_XIndexAccess.py
+++ b/pyuno/qa/pytests/testcollections_XIndexAccess.py
@@ -77,6 +77,8 @@ class TestXIndexAccess(CollectionsTestBase):
# Then
self.assertEqual(0, count)
+ doc.close(True);
+
# Tests syntax:
# num = len(obj) # Number of elements
# For:
@@ -94,6 +96,8 @@ class TestXIndexAccess(CollectionsTestBase):
# Then
self.assertEqual(1, count)
+ doc.close(True);
+
# Tests syntax:
# val = obj[0] # Access by index
# For:
@@ -117,6 +121,7 @@ class TestXIndexAccess(CollectionsTestBase):
self.readValuesTestFixture(doc, 2, 1, 1)
self.readValuesTestFixture(doc, 2, 2, IndexError)
self.readValuesTestFixture(doc, 2, 3, IndexError)
+ doc.close(True);
def test_XIndexAccess_ReadIndex_Single_Invalid(self):
doc = self.createBlankTextDocument()
@@ -126,6 +131,7 @@ class TestXIndexAccess(CollectionsTestBase):
self.readValuesTestFixture(doc, 0, (0, 1), TypeError)
self.readValuesTestFixture(doc, 0, [0, 1], TypeError)
self.readValuesTestFixture(doc, 0, {'a': 'b'}, TypeError)
+ doc.close(True);
# Tests syntax:
# val1,val2 = obj[2:4] # Access by slice
@@ -139,6 +145,7 @@ class TestXIndexAccess(CollectionsTestBase):
key = slice(j, k)
expected = t[key]
self.readValuesTestFixture(doc, i, key, expected)
+ doc.close(True);
# Tests syntax:
# val1,val2 = obj[0:3:2] # Access by extended slice
@@ -153,6 +160,7 @@ class TestXIndexAccess(CollectionsTestBase):
key = slice(j, k, l)
expected = t[key]
self.readValuesTestFixture(doc, i, key, expected)
+ doc.close(True);
# Tests syntax:
# if val in obj: ... # Test value presence
@@ -173,6 +181,8 @@ class TestXIndexAccess(CollectionsTestBase):
# Then
self.assertTrue(present)
+ doc.close(True);
+
# Tests syntax:
# if val in obj: ... # Test value presence
# For:
@@ -187,6 +197,8 @@ class TestXIndexAccess(CollectionsTestBase):
# Then
self.assertFalse(present)
+ doc.close(True);
+
# Tests syntax:
# if val in obj: ... # Test value presence
# For:
@@ -201,6 +213,8 @@ class TestXIndexAccess(CollectionsTestBase):
# Then
self.assertFalse(present)
+ doc.close(True);
+
# Tests syntax:
# if val in obj: ... # Test value presence
# For:
@@ -213,6 +227,8 @@ class TestXIndexAccess(CollectionsTestBase):
with self.assertRaises(TypeError):
present = {} in doc.Footnotes
+ doc.close(True);
+
# Tests syntax:
# for val in obj: ... # Implicit iterator (values)
# For:
@@ -229,6 +245,8 @@ class TestXIndexAccess(CollectionsTestBase):
# Then
self.assertEqual(0, len(read_footnotes))
+ doc.close(True);
+
# Tests syntax:
# for val in obj: ... # Implicit iterator (values)
# For:
@@ -250,6 +268,8 @@ class TestXIndexAccess(CollectionsTestBase):
self.assertEqual(1, len(read_footnotes))
self.assertEqual('foo', read_footnotes[0].Label)
+ doc.close(True);
+
# Tests syntax:
# for val in obj: ... # Implicit iterator (values)
# For:
@@ -275,6 +295,8 @@ class TestXIndexAccess(CollectionsTestBase):
self.assertEqual('foo', read_footnotes[0].Label)
self.assertEqual('bar', read_footnotes[1].Label)
+ doc.close(True);
+
# Tests syntax:
# itr = iter(obj) # Named iterator (values)
# For:
@@ -295,6 +317,8 @@ class TestXIndexAccess(CollectionsTestBase):
with self.assertRaises(StopIteration):
next(itr)
+ doc.close(True);
+
if __name__ == '__main__':
unittest.main()