Exemplo n.º 1
0
    def handle_load_current_run(self):

        try:
            current_run_file = file_utils.get_current_run_filename(self.get_current_instrument())
        except ValueError as error:
            self._view.warning_popup(error.args[0])
            return

        if current_run_file == "":
            self._view.warning_popup("Cannot find directory for current instrument : " + self._instrument)
            return

        self.handle_loading_current_run([current_run_file], self._use_threading)
Exemplo n.º 2
0
    def handle_load_current_run(self):
        try:
            current_run_file = file_utils.get_current_run_filename(
                self.get_current_instrument())
        except ValueError as error:
            self._view.warning_popup(error.args[0])
            return

        if current_run_file == "":
            self._view.warning_popup(
                "Cannot find directory for current instrument : " +
                self._instrument)
            return

        self.run_list = ['Current']
        self.load_runs([current_run_file])
Exemplo n.º 3
0
 def test_that_get_current_run_throws_if_no_valid_run_in_autosave_run(self):
     utils.check_file_exists = mock.Mock(side_effect=[True, False])
     with self.assertRaises(ValueError):
         utils.get_current_run_filename("EMU")
Exemplo n.º 4
0
    def test_that_get_current_run_filename_throws_if_autosave_file_not_found(
            self):
        utils.check_file_exists = mock.Mock(return_value=False)

        with self.assertRaises(ValueError):
            utils.get_current_run_filename("EMU")
Exemplo n.º 5
0
    def test_that_get_current_run_filename_throws_if_autosave_file_not_found(self):
        utils.check_file_exists = mock.Mock(return_value=False)

        with self.assertRaises(ValueError):
            utils.get_current_run_filename("EMU")