summaryrefslogtreecommitdiff
path: root/sc/qa/uitest/calc_tests9/tdf125440.py
diff options
context:
space:
mode:
Diffstat (limited to 'sc/qa/uitest/calc_tests9/tdf125440.py')
-rw-r--r--sc/qa/uitest/calc_tests9/tdf125440.py35
1 files changed, 17 insertions, 18 deletions
diff --git a/sc/qa/uitest/calc_tests9/tdf125440.py b/sc/qa/uitest/calc_tests9/tdf125440.py
index 12e113a1c17c..82accfb11942 100644
--- a/sc/qa/uitest/calc_tests9/tdf125440.py
+++ b/sc/qa/uitest/calc_tests9/tdf125440.py
@@ -14,29 +14,28 @@ class Tdf1254400(UITestCase):
def test_tdf125440(self):
# In order to simulate copy&paste from external source,
# import the text in Writer, copy it and paste it in Calc
- writer_doc = self.ui_test.load_file(get_url_for_data_file("tdf125440.odt"))
+ with self.ui_test.load_file(get_url_for_data_file("tdf125440.odt")) as writer_doc:
- self.xUITest.executeCommand(".uno:SelectAll")
- self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:Copy")
- # Close the document
- self.xUITest.executeCommand(".uno:CloseDoc")
+ # Close the document
+ self.xUITest.executeCommand(".uno:CloseDoc")
- calc_doc = self.ui_test.create_doc_in_start_center("calc")
+ calc_doc = self.ui_test.create_doc_in_start_center("calc")
- xCalcDoc = self.xUITest.getTopFocusWindow()
- gridwin = xCalcDoc.getChild("grid_window")
- document = self.ui_test.get_component()
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ document = self.ui_test.get_component()
- gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
- self.xUITest.executeCommand(".uno:PasteUnformatted")
+ self.xUITest.executeCommand(".uno:PasteUnformatted")
- # Without the fix in place, this test would have failed with
- # AssertionError: 'Row' != '"Row"'
- self.assertEqual("Row", get_cell_by_position(document, 0, 0, 0).getString())
- self.assertEqual("", get_cell_by_position(document, 0, 1, 0).getString())
- self.assertEqual("", get_cell_by_position(document, 0, 2, 0).getString())
- self.assertEqual("50", get_cell_by_position(document, 0, 3, 0).getString())
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'Row' != '"Row"'
+ self.assertEqual("Row", get_cell_by_position(document, 0, 0, 0).getString())
+ self.assertEqual("", get_cell_by_position(document, 0, 1, 0).getString())
+ self.assertEqual("", get_cell_by_position(document, 0, 2, 0).getString())
+ self.assertEqual("50", get_cell_by_position(document, 0, 3, 0).getString())
- self.ui_test.close_doc()