Changeset 144fe21 in sasview for src/sas/qtgui/Perspectives/Fitting
- Timestamp:
- Jul 26, 2018 5:30:15 AM (6 years ago)
- Branches:
- ESS_GUI, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc
- Children:
- dc71408
- Parents:
- e793f62
- git-author:
- Piotr Rozyczko <rozyczko@…> (07/26/18 05:28:51)
- git-committer:
- Piotr Rozyczko <rozyczko@…> (07/26/18 05:30:15)
- Location:
- src/sas/qtgui/Perspectives/Fitting/UnitTesting
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingPerspectiveTest.py
r6548a01 r144fe21 44 44 self.assertEqual(len(self.widget.tabs), 1) 45 45 self.assertEqual(self.widget.maxIndex, 2) 46 self.assertEqual(self.widget.getTabName(), "FitPage 1")46 self.assertEqual(self.widget.getTabName(), "FitPage2") 47 47 48 48 def testAddTab(self): … … 52 52 self.widget.addFit(None) 53 53 self.assertEqual(len(self.widget.tabs), 2) 54 self.assertEqual(self.widget.getTabName(), "FitPage 2")54 self.assertEqual(self.widget.getTabName(), "FitPage3") 55 55 self.assertEqual(self.widget.maxIndex, 3) 56 56 # Add an empty batch tab 57 57 self.widget.addFit(None, is_batch=True) 58 58 self.assertEqual(len(self.widget.tabs), 3) 59 self.assertEqual(self.widget.getTabName(2), "BatchPage 3")59 self.assertEqual(self.widget.getTabName(2), "BatchPage4") 60 60 self.assertEqual(self.widget.maxIndex, 4) 61 61 … … 69 69 ''' Remove data from last tab''' 70 70 self.assertEqual(len(self.widget.tabs), 1) 71 self.assertEqual(self.widget.getTabName(), "FitPage 1")71 self.assertEqual(self.widget.getTabName(), "FitPage2") 72 72 self.assertEqual(self.widget.maxIndex, 2) 73 73 … … 77 77 # see that the tab didn't disappear, just changed the name/id 78 78 self.assertEqual(len(self.widget.tabs), 1) 79 self.assertEqual(self.widget.getTabName(), "FitPage 2")79 self.assertEqual(self.widget.getTabName(), "FitPage3") 80 80 self.assertEqual(self.widget.maxIndex, 3) 81 81 … … 101 101 self.assertEqual(len(self.widget.tabs), 1) 102 102 self.assertEqual(self.widget.maxIndex, 3) 103 self.assertEqual(self.widget.getTabName(), "FitPage 2")103 self.assertEqual(self.widget.getTabName(), "FitPage3") 104 104 105 105 # Attemtp to remove the last tab … … 108 108 self.assertEqual(len(self.widget.tabs), 1) 109 109 self.assertEqual(self.widget.maxIndex, 4) 110 self.assertEqual(self.widget.getTabName(), "FitPage 3")110 self.assertEqual(self.widget.getTabName(), "FitPage4") 111 111 112 112 def testAllowBatch(self): -
src/sas/qtgui/Perspectives/Fitting/UnitTesting/FittingWidgetTest.py
re793f62 r144fe21 411 411 category_index = self.widget.cbCategory.findText("Cylinder") 412 412 self.widget.cbCategory.setCurrentIndex(category_index) 413 model_index = self.widget.cbModel.findText("barbell") 414 self.widget.cbModel.setCurrentIndex(model_index) 413 415 414 416 # click on a poly parameter checkbox 415 417 index = self.widget._poly_model.index(0,0) 418 419 #self.widget.show() 420 #QtWidgets.QApplication(sys.argv).exec_() 421 422 416 423 # Set the checbox 417 424 self.widget._poly_model.item(0,0).setCheckState(2) … … 455 462 category_index = self.widget.cbCategory.findText("Cylinder") 456 463 self.widget.cbCategory.setCurrentIndex(category_index) 464 model_index = self.widget.cbModel.findText("barbell") 465 self.widget.cbModel.setCurrentIndex(model_index) 457 466 458 467 # call method with default settings … … 494 503 category_index = self.widget.cbCategory.findText("Cylinder") 495 504 self.widget.cbCategory.setCurrentIndex(category_index) 505 model_index = self.widget.cbModel.findText("barbell") 506 self.widget.cbModel.setCurrentIndex(model_index) 496 507 497 508 self.widget.onPolyComboIndexChange('array', 0) … … 524 535 525 536 # Check the magnetic model 526 self.assertEqual(self.widget._magnet_model.rowCount(), 9)537 self.assertEqual(self.widget._magnet_model.rowCount(), 12) 527 538 self.assertEqual(self.widget._magnet_model.columnCount(), 5) 528 539 … … 535 546 536 547 header_tooltips = ['Select parameter for fitting', 537 538 539 540 548 'Enter parameter value', 549 'Enter minimum value for parameter', 550 'Enter maximum value for parameter', 551 'Unit of the parameter'] 541 552 for column, tooltip in enumerate(header_tooltips): 542 553 self.assertEqual(self.widget._magnet_model.headerData(column, … … 942 953 self.assertTrue(fp.data_is_loaded) 943 954 self.assertEqual(fp.current_category, "Sphere") 944 self.assertEqual(fp.current_model, " adsorbed_layer")955 self.assertEqual(fp.current_model, "binary_hard_sphere") 945 956 self.assertListEqual(fp.parameters_to_fit, ['scale']) 946 957
Note: See TracChangeset
for help on using the changeset viewer.