diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-17 11:55:38 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-17 14:36:51 +0200 |
commit | bdc299626e3688b631aafe8a1c71ca78ceab6dea (patch) | |
tree | 70dba14de64ac733feb8e55a7d1f39b1c944b8e5 /sources/pyside2/tests | |
parent | 33ea42411bddeb6bbecbb96a0db98947906b1792 (diff) |
uiloader_test.py: Remove unused/duplicated code
Remove remains of some old test apparently testing UTF-8
paths which was identical to the existing testLoadFile().
Task-number: PYSIDE-1070
Change-Id: I50912996272a407654f070854523729ba4220b48
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/tests')
-rw-r--r-- | sources/pyside2/tests/QtUiTools/uiloader_test.py | 26 |
1 files changed, 6 insertions, 20 deletions
diff --git a/sources/pyside2/tests/QtUiTools/uiloader_test.py b/sources/pyside2/tests/QtUiTools/uiloader_test.py index 48b401426..07461ca2f 100644 --- a/sources/pyside2/tests/QtUiTools/uiloader_test.py +++ b/sources/pyside2/tests/QtUiTools/uiloader_test.py @@ -39,18 +39,16 @@ from helper.usesqapplication import UsesQApplication from PySide2.QtWidgets import QWidget from PySide2.QtUiTools import QUiLoader -def get_file_path(): - for path in file_path: - if os.path.exists(path): - return path - return "" -class QUioaderTeste(UsesQApplication): +class QUiLoaderTester(UsesQApplication): + def setUp(self): + UsesQApplication.setUp(self) + self._filePath = os.path.join(os.path.dirname(__file__), 'test.ui') + def testLoadFile(self): - filePath = os.path.join(os.path.dirname(__file__), 'test.ui') loader = QUiLoader() parent = QWidget() - w = loader.load(filePath, parent) + w = loader.load(self._filePath, parent) self.assertNotEqual(w, None) self.assertEqual(len(parent.children()), 1) @@ -59,18 +57,6 @@ class QUioaderTeste(UsesQApplication): self.assertNotEqual(child, None) self.assertEqual(w.findChild(QWidget, "grandson_object"), child.findChild(QWidget, "grandson_object")) - def testLoadFileUnicodeFilePath(self): - filePath = str(os.path.join(os.path.dirname(__file__), 'test.ui')) - loader = QUiLoader() - parent = QWidget() - w = loader.load(filePath, parent) - self.assertNotEqual(w, None) - - self.assertEqual(len(parent.children()), 1) - - child = w.findChild(QWidget, "child_object") - self.assertNotEqual(child, None) - self.assertEqual(w.findChild(QWidget, "grandson_object"), child.findChild(QWidget, "grandson_object")) if __name__ == '__main__': unittest.main() |