Changeset 14ec91c5 in sasview for src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingOptionsTest.py
- Timestamp:
- Feb 2, 2018 9:21:48 AM (7 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:
- a90c9c5
- Parents:
- 5e66738
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingOptionsTest.py
r53c771e r14ec91c5 1 1 import sys 2 2 import unittest 3 import webbrowser 3 4 from bumps import options 4 5 … … 114 115 115 116 # test disabled until pyQt5 works well 116 def notestOnHelp(self):117 def testOnHelp(self): 117 118 ''' Test help display''' 118 #Mock the QWebView method 119 QtWebKit.QWebView.show = MagicMock() 120 QtWebKit.QWebView.load = MagicMock() 119 webbrowser.open = MagicMock() 121 120 122 121 # Invoke the action on default tab 123 122 self.widget.onHelp() 124 123 # Check if show() got called 125 self.assertTrue( QtWebKit.QWebView.show.called)124 self.assertTrue(webbrowser.open.called) 126 125 # Assure the filename is correct 127 self.assertIn("optimizer.html", QtWebKit.QWebView.load.call_args[0][0].toString())126 self.assertIn("optimizer.html", webbrowser.open.call_args[0][0]) 128 127 129 128 # Change the combo index … … 131 130 self.widget.onHelp() 132 131 # Check if show() got called 133 self.assertEqual( QtWebKit.QWebView.show.call_count, 2)132 self.assertEqual(webbrowser.open.call_count, 2) 134 133 # Assure the filename is correct 135 self.assertIn("fit-dream", QtWebKit.QWebView.load.call_args[0][0].toString())134 self.assertIn("fit-dream", webbrowser.open.call_args[0][0]) 136 135 137 136 # Change the index again … … 139 138 self.widget.onHelp() 140 139 # Check if show() got called 141 self.assertEqual( QtWebKit.QWebView.show.call_count, 3)140 self.assertEqual(webbrowser.open.call_count, 3) 142 141 # Assure the filename is correct 143 self.assertIn("fit-lm", QtWebKit.QWebView.load.call_args[0][0].toString())142 self.assertIn("fit-lm", webbrowser.open.call_args[0][0]) 144 143 145 144 def testWidgetFromOptions(self):
Note: See TracChangeset
for help on using the changeset viewer.