Ignore:
Timestamp:
Nov 9, 2017 6:41:56 AM (6 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:
4992ff2
Parents:
cee5c78
git-author:
Piotr Rozyczko <rozyczko@…> (10/27/17 06:49:35)
git-committer:
Piotr Rozyczko <rozyczko@…> (11/09/17 06:41:56)
Message:

Update for unit tests and minor functionality quirks

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py

    • Property mode changed from 100644 to 100755
    r9ea43c82 r7fb471d  
    66from PyQt4 import QtTest 
    77from PyQt4 import QtCore 
    8 from mock import MagicMock 
     8from unittest.mock import MagicMock 
    99from twisted.internet import threads 
    1010 
     
    6060 
    6161        #Test loading from json categories 
    62         category_list = fittingWindow.master_category_dict.keys() 
     62        category_list = list(fittingWindow.master_category_dict.keys()) 
    6363 
    6464        for category in category_list: 
     
    9393        fittingWindow.SASModelToQModel("cylinder") 
    9494        pd_index = fittingWindow.lstPoly.model().index(0,0) 
    95         self.assertEqual(str(pd_index.data().toString()), "Distribution of radius") 
     95        self.assertEqual(str(pd_index.data()), "Distribution of radius") 
    9696        pd_index = fittingWindow.lstPoly.model().index(1,0) 
    97         self.assertEqual(str(pd_index.data().toString()), "Distribution of length") 
     97        self.assertEqual(str(pd_index.data()), "Distribution of length") 
    9898 
    9999        # test the delegate a bit 
     
    394394 
    395395        # Test presence of comboboxes in last column 
    396         for row in xrange(self.widget._poly_model.rowCount()): 
     396        for row in range(self.widget._poly_model.rowCount()): 
    397397            func_index = self.widget._poly_model.index(row, 6) 
    398398            self.assertTrue(isinstance(self.widget.lstPoly.indexWidget(func_index), QtGui.QComboBox)) 
     
    542542 
    543543        # Test rows 
    544         for row in xrange(self.widget._magnet_model.rowCount()): 
     544        for row in range(self.widget._magnet_model.rowCount()): 
    545545            func_index = self.widget._magnet_model.index(row, 0) 
    546546            self.assertIn(':', self.widget._magnet_model.item(row, 0).text()) 
     
    981981 
    982982        # check that range of variation for this parameter has NOT been changed 
    983         print self.widget.kernel_module.details[name_modified_param] 
     983        print(self.widget.kernel_module.details[name_modified_param]) 
    984984        self.assertNotIn(new_value, self.widget.kernel_module.details[name_modified_param] ) 
    985985 
Note: See TracChangeset for help on using the changeset viewer.