Ignore:
Timestamp:
Feb 2, 2018 9:21:48 AM (7 years ago)
Author:
Piotr Rozyczko <rozyczko@…>
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
Message:

More code review related fixes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingOptionsTest.py

    r53c771e r14ec91c5  
    11import sys 
    22import unittest 
     3import webbrowser 
    34from bumps import options 
    45 
     
    114115 
    115116    # test disabled until pyQt5 works well 
    116     def notestOnHelp(self): 
     117    def testOnHelp(self): 
    117118        ''' Test help display''' 
    118         #Mock the QWebView method 
    119         QtWebKit.QWebView.show = MagicMock() 
    120         QtWebKit.QWebView.load = MagicMock() 
     119        webbrowser.open = MagicMock() 
    121120 
    122121        # Invoke the action on default tab 
    123122        self.widget.onHelp() 
    124123        # Check if show() got called 
    125         self.assertTrue(QtWebKit.QWebView.show.called) 
     124        self.assertTrue(webbrowser.open.called) 
    126125        # 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]) 
    128127 
    129128        # Change the combo index 
     
    131130        self.widget.onHelp() 
    132131        # Check if show() got called 
    133         self.assertEqual(QtWebKit.QWebView.show.call_count, 2) 
     132        self.assertEqual(webbrowser.open.call_count, 2) 
    134133        # 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]) 
    136135 
    137136        # Change the index again 
     
    139138        self.widget.onHelp() 
    140139        # Check if show() got called 
    141         self.assertEqual(QtWebKit.QWebView.show.call_count, 3) 
     140        self.assertEqual(webbrowser.open.call_count, 3) 
    142141        # 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]) 
    144143 
    145144    def testWidgetFromOptions(self): 
Note: See TracChangeset for help on using the changeset viewer.