Changeset 34f13a83 in sasview for src/sas/qtgui/Plotting/UnitTesting


Ignore:
Timestamp:
Sep 25, 2018 9:50:18 AM (6 years ago)
Author:
Piotr Rozyczko <piotr.rozyczko@…>
Branches:
ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
Children:
cb39d66
Parents:
624c8747
Message:

Disabled native matplotlib toolbar due to bugs in its 2.1.0
implementation. Will revisit when upgrading to 3.0.
SASVIEW-1103, SASVIEW-1106

Location:
src/sas/qtgui/Plotting/UnitTesting
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Plotting/UnitTesting/Plotter2DTest.py

    r863ebca r34f13a83  
    146146        self.plotter.createContextMenuQuick() 
    147147        actions = self.plotter.contextMenu.actions() 
    148         self.assertEqual(len(actions), 9) 
     148        self.assertEqual(len(actions), 7) 
    149149 
    150150        # Trigger Print Image and make sure the method is called 
     
    158158 
    159159        # Trigger Toggle Grid and make sure the method is called 
    160         self.assertEqual(actions[6].text(), "Toggle Grid On/Off") 
     160        self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 
    161161        self.plotter.ax.grid = MagicMock() 
     162        actions[4].trigger() 
     163        self.assertTrue(self.plotter.ax.grid.called) 
     164 
     165        # Trigger Change Scale and make sure the method is called 
     166        self.assertEqual(actions[6].text(), "Toggle Linear/Log Scale") 
     167        FigureCanvas.draw_idle = MagicMock() 
    162168        actions[6].trigger() 
    163         self.assertTrue(self.plotter.ax.grid.called) 
    164  
    165         # Trigger Change Scale and make sure the method is called 
    166         self.assertEqual(actions[8].text(), "Toggle Linear/Log Scale") 
    167         FigureCanvas.draw_idle = MagicMock() 
    168         actions[8].trigger() 
    169169        self.assertTrue(FigureCanvas.draw_idle.called) 
    170170 
  • src/sas/qtgui/Plotting/UnitTesting/PlotterBaseTest.py

    r863ebca r34f13a83  
    124124 
    125125        actions = self.plotter.contextMenu.actions() 
    126         self.assertEqual(len(actions), 6) 
     126        self.assertEqual(len(actions), 4) 
    127127 
    128128        # Trigger Print Image and make sure the method is called 
     
    147147        self.assertTrue(self.clipboard_called) 
    148148 
    149         # Trigger toggle navigation bar and make sure the method is called 
    150         self.assertEqual(actions[4].text(), "Toggle Navigation Menu") 
    151         isShown = self.plotter.toolbar.isVisible() 
    152         self.assertTrue(isShow) 
    153         actions[4].trigger() 
    154         isShown = self.plotter.toolbar.isVisible() 
    155         self.assertFalse(isShow) 
    156         actions[4].trigger() 
    157         isShown = self.plotter.toolbar.isVisible() 
    158         self.assertTrue(isShow) 
     149        ## Trigger toggle navigation bar and make sure the method is called 
     150        #self.assertEqual(actions[4].text(), "Toggle Navigation Menu") 
     151        #isShown = self.plotter.toolbar.isVisible() 
     152        #self.assertTrue(isShow) 
     153        #actions[4].trigger() 
     154        #isShown = self.plotter.toolbar.isVisible() 
     155        #self.assertFalse(isShow) 
     156        #actions[4].trigger() 
     157        #isShown = self.plotter.toolbar.isVisible() 
     158        #self.assertTrue(isShow) 
    159159 
    160160 
  • src/sas/qtgui/Plotting/UnitTesting/PlotterTest.py

    r863ebca r34f13a83  
    103103        self.plotter.createContextMenuQuick() 
    104104        actions = self.plotter.contextMenu.actions() 
    105         self.assertEqual(len(actions), 9) 
     105        self.assertEqual(len(actions), 7) 
    106106 
    107107        # Trigger Print Image and make sure the method is called 
     
    115115 
    116116        # Trigger Toggle Grid and make sure the method is called 
    117         self.assertEqual(actions[6].text(), "Toggle Grid On/Off") 
     117        self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 
    118118        self.plotter.ax.grid = MagicMock() 
     119        actions[4].trigger() 
     120        self.assertTrue(self.plotter.ax.grid.called) 
     121 
     122        # Trigger Change Scale and make sure the method is called 
     123        self.assertEqual(actions[6].text(), "Change Scale") 
     124        self.plotter.properties.exec_ = MagicMock(return_value=QtWidgets.QDialog.Rejected) 
    119125        actions[6].trigger() 
    120         self.assertTrue(self.plotter.ax.grid.called) 
    121  
    122         # Trigger Change Scale and make sure the method is called 
    123         self.assertEqual(actions[8].text(), "Change Scale") 
    124         self.plotter.properties.exec_ = MagicMock(return_value=QtWidgets.QDialog.Rejected) 
    125         actions[8].trigger() 
    126126        self.assertTrue(self.plotter.properties.exec_.called) 
    127127 
Note: See TracChangeset for help on using the changeset viewer.