Ignore:
Timestamp:
Aug 22, 2017 6:10:57 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:
e43fc91
Parents:
464cd07
Message:

Allow QClipboard tests on windows only

File:
1 edited

Legend:

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

    r464cd07 rb2a5042  
    11import sys 
    22import unittest 
     3import platform 
    34 
    45from PyQt4 import QtGui 
     
    3738        self.data.name="Test name" 
    3839        self.data.id = 1 
     40        self.isWindows = platform.system=="Windows" 
    3941 
    4042    def tearDown(self): 
     
    9496        self.assertEqual(actions[2].text(), "Copy to Clipboard") 
    9597 
     98        # Trigger Toggle Grid and make sure the method is called 
     99        self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 
     100        self.plotter.ax.grid = MagicMock() 
     101        actions[4].trigger() 
     102        self.assertTrue(self.plotter.ax.grid.called) 
     103 
     104        # Trigger Change Scale and make sure the method is called 
     105        self.assertEqual(actions[6].text(), "Change Scale") 
     106        self.plotter.properties.exec_ = MagicMock(return_value=QtGui.QDialog.Rejected) 
     107        actions[6].trigger() 
     108        self.assertTrue(self.plotter.properties.exec_.called) 
     109 
    96110        # Spy on cliboard's dataChanged() signal 
     111        if not self.isWindows: 
     112            return 
    97113        self.clipboard_called = False 
    98114        def done(): 
     
    102118        QtGui.qApp.processEvents() 
    103119        # Make sure clipboard got updated. 
    104         #self.assertTrue(self.clipboard_called) 
    105  
    106         # Trigger Toggle Grid and make sure the method is called 
    107         self.assertEqual(actions[4].text(), "Toggle Grid On/Off") 
    108         self.plotter.ax.grid = MagicMock() 
    109         actions[4].trigger() 
    110         self.assertTrue(self.plotter.ax.grid.called) 
    111  
    112         # Trigger Change Scale and make sure the method is called 
    113         self.assertEqual(actions[6].text(), "Change Scale") 
    114         self.plotter.properties.exec_ = MagicMock(return_value=QtGui.QDialog.Rejected) 
    115         actions[6].trigger() 
    116         self.assertTrue(self.plotter.properties.exec_.called) 
     120        self.assertTrue(self.clipboard_called) 
    117121 
    118122    def testXyTransform(self): 
Note: See TracChangeset for help on using the changeset viewer.