diff options
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() |
