Changeset 8548d739 in sasview for src/sas/qtgui/UnitTesting


Ignore:
Timestamp:
Nov 29, 2016 8:08:29 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:
ded2ce3
Parents:
adf81b8
git-author:
Piotr Rozyczko <rozyczko@…> (11/29/16 08:04:46)
git-committer:
Piotr Rozyczko <rozyczko@…> (11/29/16 08:08:29)
Message:

Further work on the main QStandardItemModel

File:
1 edited

Legend:

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

    r31c5b58 r8548d739  
    7373            self.assertIn(signal, dir(com)) 
    7474 
    75  
    76     def testUpdateModelItem(self): 
    77         """ 
    78         Test the QModelItem update method 
     75    def testupdateModelItem(self): 
     76        """ 
     77        Test the generic QModelItem update method 
     78        """ 
     79        test_item = QtGui.QStandardItem() 
     80        test_list = ['aa', 4, True, ] 
     81        name = "Black Sabbath" 
     82 
     83        # update the item 
     84        updateModelItem(test_item, test_list, name) 
     85 
     86        # Make sure test_item got all data added 
     87        self.assertEqual(test_item.child(0).text(), name) 
     88        list_from_item = test_item.child(0).data().toList() 
     89        self.assertIsInstance(list_from_item, list) 
     90        self.assertEqual(list_from_item[0].toPyObject(), test_list[0]) 
     91        self.assertEqual(list_from_item[1].toPyObject(), test_list[1]) 
     92        self.assertEqual(list_from_item[2].toPyObject(), test_list[2]) 
     93 
     94    def testupdateModelItemWithPlot(self): 
     95        """ 
     96        Test the QModelItem checkbox update method 
    7997        """ 
    8098        test_item = QtGui.QStandardItem() 
     
    84102 
    85103        # update the item 
    86         updateModelItem(test_item, update_data, name) 
     104        updateModelItemWithPlot(test_item, update_data, name) 
    87105         
    88106        # Make sure test_item got all data added 
Note: See TracChangeset for help on using the changeset viewer.