Ignore:
Timestamp:
Dec 13, 2016 4:28:07 AM (8 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:
63974f0
Parents:
c4e5400
Message:

Added window title GUI for charts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/UnitTesting/PlotterBaseTest.py

    rc4e5400 r27313b7  
    1313 
    1414from sas.qtgui.ScaleProperties import ScaleProperties 
     15from sas.qtgui.WindowTitle import WindowTitle 
    1516#import sas.qtgui.GuiUtils as GuiUtils 
    1617from sas.qtgui.GuiUtils import * 
     
    155156        self.assertTrue(self.clipboard_called) 
    156157 
     158    def testOnWindowsTitle(self): 
     159        ''' test changing the plot title''' 
     160        # Mock the modal dialog's response 
     161        QtGui.QDialog.exec_ = MagicMock(return_value=QtGui.QDialog.Accepted) 
     162        self.plotter.show() 
     163        # Assure the original title is none 
     164        self.assertEqual(self.plotter.windowTitle(), "") 
     165        self.plotter.manager.communicator = MagicMock() 
     166 
     167        WindowTitle.title = MagicMock(return_value="I am a new title") 
     168        # Change the title 
     169        self.plotter.onWindowsTitle() 
     170 
     171        self.assertEqual(self.plotter.windowTitle(), "I am a new title") 
    157172 
    158173if __name__ == "__main__": 
Note: See TracChangeset for help on using the changeset viewer.