def setUp(self):
        config.setFacility("ISIS")
        config.setString("default.instrument", "SANS2D")
        patcher = mock.patch('sans.gui_logic.presenter.run_tab_presenter.BatchCsvParser')
        self.addCleanup(patcher.stop)
        self.BatchCsvParserMock = patcher.start()

        self.os_patcher = mock.patch('sans.gui_logic.presenter.run_tab_presenter.os')
        self.addCleanup(self.os_patcher.stop)
        self.osMock = self.os_patcher.start()
    def test_setup_instrument_specific_settings_sets_facility_in_config(self):
        config.setFacility('TEST_LIVE')

        self.presenter.set_view(mock.MagicMock())
        self.presenter._beam_centre_presenter = mock.MagicMock()
        self.presenter._workspace_diagnostic_presenter = mock.MagicMock()
        instrument = SANSInstrument.LOQ

        self.presenter._setup_instrument_specific_settings(instrument)
        self.assertEqual(config.getFacility().name(), 'ISIS')
    def setUp(self):
        config.setFacility("ISIS")
        config.setString("default.instrument", "SANS2D")
        patcher = mock.patch('sans.gui_logic.presenter.run_tab_presenter.BatchCsvParser')
        self.addCleanup(patcher.stop)
        self.BatchCsvParserMock = patcher.start()

        self.os_patcher = mock.patch('sans.gui_logic.presenter.run_tab_presenter.os')
        self.addCleanup(self.os_patcher.stop)
        self.osMock = self.os_patcher.start()
Example #4
0
    def setUp(self):
        config.setFacility("ISIS")

        patcher = mock.patch('sans.gui_logic.presenter.run_tab_presenter.BatchCsvParser')
        self.addCleanup(patcher.stop)
        self.BatchCsvParserMock = patcher.start()

        self.os_patcher = mock.patch('sans.gui_logic.presenter.run_tab_presenter.os')
        self.addCleanup(self.os_patcher.stop)
        self.osMock = self.os_patcher.start()

        self.thickness_patcher = mock.patch('sans.gui_logic.models.table_model.create_file_information')
        self.addCleanup(self.thickness_patcher.stop)
        self.thickness_patcher.start()
 def tearDown(self):
     config.setFacility(self._oldFacility)
 def setUp(self):
     self._oldFacility = config['default.facility']
     if self._oldFacility.strip() == '':
         self._oldFacility = 'TEST_LIVE'
     config.setFacility('ISIS')
Example #7
0
 def tearDown(self):
     config.setFacility(self._oldFacility)
     AnalysisDataService.clear()
Example #8
0
 def setUp(self):
     config.setFacility("ISIS")
     config.setString("default.instrument", "SANS2D")
 def tearDown(self):
     config.setFacility(self._oldFacility)
     AnalysisDataService.clear()