Ignore:
Timestamp:
Dec 6, 2016 5:39:24 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:
55d89f8
Parents:
b94889a
git-author:
Piotr Rozyczko <rozyczko@…> (12/06/16 05:38:55)
git-committer:
Piotr Rozyczko <rozyczko@…> (12/06/16 05:39:24)
Message:

More functionality for quick plots + unit tests

File:
1 edited

Legend:

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

    r31c5b58 r6d05e1d  
    506506        self.assertTrue(self.form.manager.add_data.called) 
    507507 
    508     def testNewPlot(self): 
     508    def testNewPlot1D(self): 
    509509        """ 
    510510        Creating new plots from Data1D/2D 
     
    521521        # get Data1D 
    522522        p_file="cyl_400_20.txt" 
     523        output_object = loader.load(p_file) 
     524        new_data = [manager.create_gui_data(output_object, p_file)] 
     525 
     526        # Mask retrieval of the data 
     527        self.form.plotsFromCheckedItems = MagicMock(return_value=new_data) 
     528 
     529        # Mask plotting 
     530        self.form.parent.workspace = MagicMock() 
     531 
     532        # Call the plotting method 
     533        self.form.newPlot() 
     534 
     535        # The plot was registered 
     536        self.assertEqual(len(PlotHelper.currentPlots()), 1) 
     537 
     538        self.assertTrue(self.form.cbgraph.isEnabled()) 
     539        self.assertTrue(self.form.cmdAppend.isEnabled()) 
     540 
     541    def testNewPlot2D(self): 
     542        """ 
     543        Creating new plots from Data1D/2D 
     544        """ 
     545        loader = Loader() 
     546        manager = DataManager() 
     547        PlotHelper.clear() 
     548        self.form.enableGraphCombo(None) 
     549 
     550        # Make sure the controls are disabled 
     551        self.assertFalse(self.form.cbgraph.isEnabled()) 
     552        self.assertFalse(self.form.cmdAppend.isEnabled()) 
     553 
     554        # get Data2D 
     555        p_file="Dec07031.ASC" 
    523556        output_object = loader.load(p_file) 
    524557        new_data = [manager.create_gui_data(output_object, p_file)] 
Note: See TracChangeset for help on using the changeset viewer.