Ignore:
Timestamp:
Jul 7, 2016 2:54:18 AM (8 years ago)
Author:
Piotr Rozyczko <piotr.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:
0cd8612
Parents:
f0f309d
Message:

Status bar, progress bar, initial treeview context menu + minor cleanup

File:
1 edited

Legend:

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

    r481ff26 re540cd2  
    9292        self.assertIsInstance(self.form.freezeView, QTreeView) 
    9393 
    94          
     94    def testWidgets(self): 
     95        """ 
     96        Test if all required widgets got added 
     97        """         
    9598    def testLoadButton(self): 
    9699        loadButton = self.form.cmdLoad 
     
    111114 
    112115        # Make sure the signal has not been emitted 
    113         #self.assertEqual(spy_file_read.count(), 0) 
     116        self.assertEqual(spy_file_read.count(), 0) 
    114117 
    115118        # Now, return a single file 
    116119        QtGui.QFileDialog.getOpenFileNames = MagicMock(return_value=filename) 
    117          
     120 
    118121        # Click on the Load button 
    119122        QTest.mouseClick(loadButton, Qt.LeftButton) 
     123        QtGui.qApp.processEvents() 
    120124 
    121125        # Test the getOpenFileName() dialog called once 
     
    127131        #self.assertIn(filename, str(spy_file_read.called()[0]['args'][0])) 
    128132 
     133    def testLoadFiles(self): 
     134        """ 
     135        Test progress bar update while loading of multiple files 
     136        """ 
     137        # Set up the spy on progress bar update signal 
     138        spy_progress_bar_update = QtSignalSpy(self.form, 
     139            self.form.communicator.progressBarUpdateSignal) 
     140 
     141        # Populate the model 
     142        filename = ["cyl_400_20.txt", "Dec07031.ASC", "cyl_400_20.txt"] 
     143        self.form.readData(filename) 
     144 
     145        # 0, 0, 33, 66, -1 -> 5 signals reaching progressBar 
     146        self.assertEqual(spy_progress_bar_update.count(), 5) 
     147 
     148        expected_list = [0, 0, 33, 66, -1] 
     149        spied_list = [spy_progress_bar_update.called()[i]['args'][0] for i in xrange(5)] 
     150        self.assertEqual(expected_list, spied_list) 
     151         
    129152    def testDeleteButton(self): 
    130153        """ 
     
    441464        default_list = defaults.split(';;') 
    442465 
    443         for format in default_list: 
    444             self.assertIn(format, w_list) 
     466        for def_format in default_list: 
     467            self.assertIn(def_format, w_list) 
    445468        
    446469    def testLoadComplete(self): 
Note: See TracChangeset for help on using the changeset viewer.