def setUp(self):
     self.model = mock.create_autospec(data_model.FittingDataModel)
     self.view = mock.create_autospec(data_view.FittingDataView)
     self.presenter = data_presenter.FittingDataPresenter(self.model, self.view)
     # TOF axes
     mock_unit_TOF = mock.MagicMock()
     mock_unit_TOF.unitID.return_value = "TOF"
     mock_axis_TOF = mock.MagicMock()
     mock_axis_TOF.getUnit.return_value = mock_unit_TOF
     # dSpacing axes
     mock_unit_d = mock.MagicMock()
     mock_unit_d.unitID.return_value = "dSpacing"
     mock_axis_d = mock.MagicMock()
     mock_axis_d.getUnit.return_value = mock_unit_d
     # make mock workspaces
     self.ws1 = mock.MagicMock()
     self.ws1.getAxis.return_value = mock_axis_TOF
     self.ws2 = mock.MagicMock()
     self.ws2.getAxis.return_value = mock_axis_TOF
     self.ws3 = mock.MagicMock()
     self.ws3.getAxis.return_value = mock_axis_d
示例#2
0
 def setUp(self):
     self.model = mock.create_autospec(data_model.FittingDataModel)
     self.view = mock.create_autospec(data_view.FittingDataView)
     self.presenter = data_presenter.FittingDataPresenter(self.model, self.view)