Changeset 0cd8612 in sasview for src/sas/qtgui/UnitTesting
- Timestamp:
- Jul 8, 2016 10:13:41 AM (8 years ago)
- Branches:
- ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- a95260d
- Parents:
- e540cd2
- Location:
- src/sas/qtgui/UnitTesting
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/UnitTesting/DataExplorerTest.py
re540cd2 r0cd8612 95 95 """ 96 96 Test if all required widgets got added 97 """ 97 """ 98 98 def testLoadButton(self): 99 99 loadButton = self.form.cmdLoad -
src/sas/qtgui/UnitTesting/GuiManagerTest.py
re540cd2 r0cd8612 48 48 self.assertIsInstance(self.manager.filesWidget, DataExplorerWindow) 49 49 self.assertIsInstance(self.manager.dockedFilesWidget, QDockWidget) 50 self.assertIsInstance(self.manager.dockedFilesWidget.widget(), DataExplorerWindow) 50 51 self.assertEqual(self.manager.dockedFilesWidget.features(), QDockWidget.NoDockWidgetFeatures) 51 52 self.assertEqual(self.manager._workspace.dockWidgetArea(self.manager.dockedFilesWidget), Qt.LeftDockWidgetArea) 53 54 self.assertIsInstance(self.manager.logDockWidget, QDockWidget) 55 self.assertIsInstance(self.manager.logDockWidget.widget(), QTextBrowser) 56 self.assertEqual(self.manager._workspace.dockWidgetArea(self.manager.logDockWidget), Qt.BottomDockWidgetArea) 57 52 58 self.assertIsInstance(self.manager.ackWidget, Acknowledgements) 53 59 self.assertIsInstance(self.manager.aboutWidget, AboutBox) 54 60 self.assertIsInstance(self.manager.welcomePanel, WelcomePanel) 61 62 def testLogging(self): 63 """ 64 Test logging of stdout, stderr and log messages 65 """ 66 # See if the log window is empty 67 self.assertEqual(self.manager.logDockWidget.widget().toPlainText(), "") 68 69 # Now, send some message to stdout. 70 # We are in the MainWindow scope, so simple 'print' will work 71 message = "from stdout" 72 print message 73 self.assertIn(message, self.manager.logDockWidget.widget().toPlainText()) 74 75 # Send some message to stderr 76 message = "from stderr" 77 sys.stderr.write(message) 78 self.assertIn(message, self.manager.logDockWidget.widget().toPlainText()) 79 80 # And finally, send a log message 81 import logging 82 message = "from logging" 83 message_logged = "ERROR: " + message 84 logging.error(message) 85 self.assertIn(message_logged, self.manager.logDockWidget.widget().toPlainText()) 55 86 56 87 def testUpdatePerspective(self):
Note: See TracChangeset
for help on using the changeset viewer.