1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 from uitest
.framework
import UITestCase
10 from uitest
.uihelper
.common
import get_state_as_dict
, select_pos
11 from libreoffice
.calc
.csv_dialog
import load_csv_file
12 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
14 class Tdf88359(UITestCase
):
16 def test_tdf88359(self
):
18 # Import the file with 'Detect Special Numbers' unchecked
19 with
load_csv_file(self
, "tdf88359.csv", True):
22 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
23 gridwin
= xCalcDoc
.getChild("grid_window")
25 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
27 with self
.ui_test
.execute_dialog_through_command(".uno:FormatCellDialog") as xDialog
:
28 xTabs
= xDialog
.getChild("tabcontrol")
29 select_pos(xTabs
, "0")
30 xliststore1
= xDialog
.getChild("categorylb")
31 xliststore2
= xDialog
.getChild("formatlb")
32 xformatted
= xDialog
.getChild("formatted")
34 # Without the fix in place, this test would have failed with
35 # AssertionError: 'Date' != 'Text'
36 self
.assertEqual("Date", get_state_as_dict(xliststore1
)["SelectEntryText"])
37 self
.assertEqual("1999-12-01T13:37:46", get_state_as_dict(xliststore2
)["SelectEntryText"])
38 self
.assertEqual("YYYY-MM-DD\"T\"HH:MM:SS", get_state_as_dict(xformatted
)["Text"])
40 # vim: set shiftwidth=4 softtabstop=4 expandtab: