Changeset 144fe21 in sasview for src/sas/qtgui/Perspectives
- 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
- Files:
-
- 4 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 -
src/sas/qtgui/Perspectives/Invariant/UnitTesting/InvariantPerspectiveTest.py
r80468f6 r144fe21 23 23 import sas.qtgui.Utilities.GuiUtils as GuiUtils 24 24 25 #if not QtWidgets.QApplication.instance():26 app = QtWidgets.QApplication(sys.argv)25 if not QtWidgets.QApplication.instance(): 26 app = QtWidgets.QApplication(sys.argv) 27 27 28 28 BG_COLOR_ERR = 'background-color: rgb(244, 170, 164);' -
src/sas/qtgui/Perspectives/Inversion/UnitTesting/InversionPerspectiveTest.py
- Property mode changed from 100755 to 100644
r72ecbdf2 r144fe21 12 12 import sas.qtgui.Utilities.GuiUtils as GuiUtils 13 13 14 #if not QtWidgets.QApplication.instance():15 app = QtWidgets.QApplication(sys.argv)14 if not QtWidgets.QApplication.instance(): 15 app = QtWidgets.QApplication(sys.argv) 16 16 17 17 … … 19 19 HELP_DIRECTORY_LOCATION = "html" 20 20 communicate = Communicate() 21 22 21 def communicator(self): 23 22 return self.communicate … … 29 28 def setUp(self): 30 29 """ Create the InversionWindow """ 31 self.widget = InversionWindow(dummy_manager()) 30 31 self.widget = InversionWindow(parent=dummy_manager()) 32 self.widget._parent = QtWidgets.QMainWindow() 33 self.widget.showBatchOutput = MagicMock() 34 self.widget.startThread = MagicMock() 35 self.widget.startThreadAll = MagicMock() 32 36 self.widget.show() 37 33 38 self.fakeData1 = GuiUtils.HashableStandardItem("A") 34 39 self.fakeData2 = GuiUtils.HashableStandardItem("B") … … 96 101 self.assertTrue(self.widget.allowBatch()) 97 102 self.assertFalse(self.widget.isBatch) 98 self.assertIsNone(self.widget.batchResultsWindow)99 103 self.assertFalse(self.widget.calculateAllButton.isEnabled()) 100 104 self.assertEqual(len(self.widget.batchResults), 0) 101 105 self.assertEqual(len(self.widget.batchComplete), 0) 102 106 self.widget.closeBatchResults() 103 self.assertIsNone(self.widget.batchResultsWindow)104 107 105 108 def zeroDataSetState(self): … … 206 209 self.assertTrue(self.widget.isMinimized()) 207 210 self.assertIsNone(self.widget.dmaxWindow) 208 self.assertIsNone(self.widget.batchResultsWindow)209 211 self.widget.setClosable(False) 210 212 self.assertFalse(self.widget.isClosable())
Note: See TracChangeset
for help on using the changeset viewer.