def test_update_preview(self):
        customizer = MainWindowCustomizer(self.gui.get_main_window(),
                                          MagicMock())
        rts = TaskDesc(definition_class=RenderingTaskDefinition)
        rts.definition.output_file = "bla"
        customizer.update_task_additional_info(rts)
        assert customizer.gui.ui.outputFile.text() == "bla"
        assert not customizer.gui.ui.previewsSlider.isVisible()
        assert customizer.preview_controller.last_preview_path == customizer.preview_controller.preview_path
        assert customizer.gui.ui.previewLabel.pixmap().width() == 298
        assert customizer.gui.ui.previewLabel.pixmap().height() == 200

        img = Image.new("RGB", (250, 123), "white")
        img_path = os.path.join(self.path, "image1.png")
        img.save(img_path)
        rts.task_state.extra_data = {"result_preview": img_path}
        customizer.update_task_additional_info(rts)
        assert customizer.gui.ui.previewLabel.pixmap().width() == 250
        assert customizer.gui.ui.previewLabel.pixmap().height() == 123

        img = Image.new("RGB", (301, 206), "white")
        img.save(img_path)
        customizer.update_task_additional_info(rts)
        assert customizer.gui.ui.previewLabel.pixmap().width() == 301
        assert customizer.gui.ui.previewLabel.pixmap().height() == 206

        rts.definition.task_type = u"Blender"
        rts.definition.options = MagicMock()
        rts.definition.options.use_frames = True
        rts.definition.options.frames = range(10)
        rts.task_state.outputs = ["result"] * 10
        rts.task_state.extra_data = {"result_preview": [img_path]}
        customizer.update_task_additional_info(rts)
 def test_show_task_result(self, mock_messagebox):
     customizer = MainWindowCustomizer(self.gui.get_main_window(),
                                       MagicMock())
     td = TaskDesc()
     td.definition.task_type = "Blender"
     td.definition.options.use_frames = True
     td.definition.output_file = os.path.join(self.path, "output.png")
     td.task_state.outputs = [
         os.path.join(self.path, u"output0011.png"),
         os.path.join(self.path, u"output0014.png"),
         os.path.join(self.path, u"output0017.png")
     ]
     td.definition.options.frames = [11, 14, 17]
     customizer.logic.get_task.return_value = td
     customizer.current_task_highlighted = td
     customizer.gui.ui.previewsSlider.setRange(1, 3)
     mock_messagebox.Critical = "CRITICAL"
     customizer.show_task_result("abc")
     expected_file = td.task_state.outputs[0]
     mock_messagebox.assert_called_with(mock_messagebox.Critical, "Error",
                                        expected_file + u" is not a file",
                                        ANY, ANY)
     customizer.gui.ui.previewsSlider.setValue(2)
     customizer.show_task_result("abc")
     expected_file = td.task_state.outputs[1]
     mock_messagebox.assert_called_with(mock_messagebox.Critical, "Error",
                                        expected_file + u" is not a file",
                                        ANY, ANY)
     customizer.gui.ui.previewsSlider.setValue(3)
     customizer.show_task_result("abc")
     expected_file = td.task_state.outputs[2]
     mock_messagebox.assert_called_with(mock_messagebox.Critical, "Error",
                                        expected_file + u" is not a file",
                                        ANY, ANY)
    def test_folderTreeView(self):
        tmp_files = self.additional_dir_content([4, [3], [2]])
        customizer = MainWindowCustomizer(self.gui.get_main_window(),
                                          MagicMock())

        customizer.gui.ui.showResourceButton.click()
        customizer.current_task_highlighted = MagicMock()
        customizer.current_task_highlighted.definition.main_scene_file = tmp_files[
            0]
        customizer.current_task_highlighted.definition.resources = tmp_files
        customizer.gui.ui.showResourceButton.click()
Beispiel #4
0
    def test_blender_customizer(self, mock_messagebox):
        self.logic.customizer = MainWindowCustomizer(self.gui.main_window,
                                                     self.logic)
        self.logic.register_new_task_type(
            BlenderTaskTypeInfo(TaskWidget(Ui_BlenderWidget),
                                BlenderRenderDialogCustomizer))
        self.logic.client = Mock()
        self.logic.client.config_desc = ClientConfigDescriptor()
        self.logic.client.config_desc.use_ipv6 = False
        self.logic.client.config_desc.max_price = 0
        self.logic.client.get_config.return_value = self.logic.client.config_desc
        self.logic.client.get_res_dirs.return_value = {'computing': self.path, 'received': self.path}
        self.logic.customizer.init_config()
        customizer = self.logic.customizer.new_task_dialog_customizer.task_customizer

        assert isinstance(customizer, FrameRendererCustomizer)
        assert not customizer.gui.ui.framesCheckBox.isChecked()
        customizer._change_options()
        assert customizer.options.frames == range(1, 11)
        customizer.gui.ui.framesCheckBox.setChecked(True)
        customizer.gui.ui.framesLineEdit.setText(u"{}".format("1;3;5-12"))
        customizer._change_options()
        assert customizer.options.frames == [1, 3] + range(5, 13)
        customizer.gui.ui.framesLineEdit.setText(u"{}".format("Not proper frames"))
        customizer._change_options()
        assert customizer.options.frames == [1, 3] + range(5, 13)
        mock_messagebox.assert_called_with(mock_messagebox.Critical, "Error",
                                           u"Wrong frame format. Frame list expected, e.g. 1;3;5-12.",
                                           ANY, ANY)
Beispiel #5
0
 def test_update_peers_view(self):
     logic = self.logic
     gui = self.app
     logic.customizer = MainWindowCustomizer(gui.main_window, logic)
     logic.customizer.new_task_dialog_customizer = Mock()
     peer = Mock()
     peer.address = "10.10.10.10"
     peer.port = 1031
     peer.key_id = "KEYID"
     peer.node_name = "NODE 1"
     peer2 = Mock()
     peer2.address = "10.10.10.20"
     peer2.port = 1034
     peer2.key_id = "KEYID2"
     peer2.node_name = "NODE 2"
     logic._update_peers_view(
         [DictSerializer.dump(peer),
          DictSerializer.dump(peer2)])
     table = logic.customizer.gui.ui.connectedPeersTable
     self.assertEqual(table.rowCount(), 2)
     self.assertEqual(table.item(0, 0).text(), "10.10.10.10")
     self.assertEqual(table.item(1, 0).text(), "10.10.10.20")
     self.assertEqual(table.item(0, 1).text(), "1031")
     self.assertEqual(table.item(1, 1).text(), "1034")
     self.assertEqual(table.item(0, 2).text(), "KEYID")
     self.assertEqual(table.item(1, 2).text(), "KEYID2")
     self.assertEqual(table.item(0, 3).text(), "NODE 1")
     self.assertEqual(table.item(1, 3).text(), "NODE 2")
    def test_preview(self):
        obj = MagicQObject()
        obj.ui.outputFile = QObject()
        obj.ui.previewLabel = MagicQObject()

        customizer = MainWindowCustomizer(obj, obj)
        self.assertTrue(
            os.path.isfile(customizer.preview_controller.preview_path))
    def test_load_task(self, mock_messagebox):

        mock_messagebox.return_value = mock_messagebox
        customizer = MainWindowCustomizer(self.gui.get_main_window(),
                                          MagicMock())
        customizer._load_new_task_from_definition = Mock()
        task_path = os.path.join(self.path, "file.gt")

        f = Mock()
        f.read.return_value = '[{"key": "value"}]'

        with patch('__builtin__.open') as mock_open:
            mock_open.return_value = f
            customizer._load_task(task_path)

            assert mock_open.called
            assert f.close.called
            assert not mock_messagebox.exec_.called
            assert customizer._load_new_task_from_definition.called

        def _raise(*_):
            raise Exception

        f.read = _raise
        customizer._load_new_task_from_definition.called = False

        with patch('__builtin__.open') as mock_open:
            mock_open.return_value = f
            customizer._load_task(task_path)

            assert mock_open.called
            assert f.close.called
            assert mock_messagebox.exec_.called
            assert not customizer._load_new_task_from_definition.called
Beispiel #8
0
 def test_change_verification_options(self):
     logic = self.logic
     logic.client = Mock()
     logic.client.datadir = self.path
     self.logic.customizer = MainWindowCustomizer(self.app.main_window,
                                                  self.logic)
     prev_y = logic.customizer.gui.ui.verificationSizeYSpinBox.maximum()
     logic.change_verification_option(size_x_max=914)
     self.assertEqual(
         logic.customizer.gui.ui.verificationSizeXSpinBox.maximum(), 914)
     self.assertEqual(
         logic.customizer.gui.ui.verificationSizeYSpinBox.maximum(), prev_y)
     logic.change_verification_option(size_y_max=123)
     self.assertEqual(
         logic.customizer.gui.ui.verificationSizeXSpinBox.maximum(), 914)
     self.assertEqual(
         logic.customizer.gui.ui.verificationSizeYSpinBox.maximum(), 123)
     logic.change_verification_option(size_y_max=3190, size_x_max=134)
     self.assertEqual(
         logic.customizer.gui.ui.verificationSizeXSpinBox.maximum(), 134)
     self.assertEqual(
         logic.customizer.gui.ui.verificationSizeYSpinBox.maximum(), 3190)
    def test_description(self):
        customizer = MainWindowCustomizer(self.gui.get_main_window(),
                                          MagicMock())
        assert isinstance(customizer, MainWindowCustomizer)
        customizer.set_options(MagicMock(), "ID1", "ETH_ADDR1", "DESC1")
        assert customizer.gui.ui.descriptionTextEdit.toPlainText() == "DESC1"
        customizer.set_options(MagicMock(), "ID1", "ETH_ADDR1", "DESC2")
        assert customizer.gui.ui.descriptionTextEdit.toPlainText() == "DESC2"
        assert customizer.gui.ui.editDescriptionButton.isEnabled()
        assert not customizer.gui.ui.saveDescriptionButton.isEnabled()
        assert not customizer.gui.ui.descriptionTextEdit.isEnabled()

        QTest.mouseClick(customizer.gui.ui.editDescriptionButton,
                         Qt.LeftButton)
        assert not customizer.gui.ui.editDescriptionButton.isEnabled()
        assert customizer.gui.ui.saveDescriptionButton.isEnabled()
        assert customizer.gui.ui.descriptionTextEdit.isEnabled()

        QTest.mouseClick(customizer.gui.ui.saveDescriptionButton,
                         Qt.LeftButton)
        assert customizer.gui.ui.editDescriptionButton.isEnabled()
        assert not customizer.gui.ui.saveDescriptionButton.isEnabled()
        assert not customizer.gui.ui.descriptionTextEdit.isEnabled()
Beispiel #10
0
    def test_lux_customizer(self, mock_file_dialog):
        self.logic.register_new_task_type(LuxRenderTaskTypeInfo(
            TaskWidget(Ui_LuxWidget), LuxRenderDialogCustomizer))
        self.logic.customizer = MainWindowCustomizer(self.gui.main_window, self.logic)
        self.logic.dir_manager = Mock()
        self.logic.dir_manager.root_path = self.path
        self.logic.client = Mock()
        self.logic.client.config_desc = ClientConfigDescriptor()
        self.logic.client.config_desc.use_ipv6 = False
        self.logic.client.config_desc.max_price = 0
        self.logic.client.get_config.return_value = self.logic.client.config_desc
        self.logic.client.get_res_dirs.return_value = {'computing': self.path, 'received': self.path}
        self.logic.customizer.init_config()
        lux_customizer = self.logic.customizer.new_task_dialog_customizer.task_customizer
        assert isinstance(lux_customizer, LuxRenderDialogCustomizer)
        assert lux_customizer.get_task_name() == "LuxRender"

        self.logic.customizer.gui.ui.resourceFilesLabel.setText("124")
        QTest.mouseClick(self.logic.customizer.gui.ui.resetToDefaultButton, Qt.LeftButton)
        assert self.logic.customizer.gui.ui.resourceFilesLabel.text() == "0"

        definition = RenderingTaskDefinition()
        lux_customizer.get_task_specific_options(definition)
        lux_customizer.load_task_definition(definition)

        path = u"{}".format(str(lux_customizer.load_setting('main_scene_path', os.path.expanduser('~'))))
        mock_file_dialog.getOpenFileName.return_value = path, None
        QTest.mouseClick(lux_customizer.gui.ui.chooseMainSceneFileButton, Qt.LeftButton)
        mock_file_dialog.getOpenFileName.assert_called_with(lux_customizer.gui,
                                                            "Choose main scene file",
                                                            path,
                                                            u"Scene files (*.LXS *.lxs)")

        lux_customizer.gui.ui.stopByTimeRadioButton.setChecked(True)
        lux_customizer.gui.ui.haltTimeLineEdit.setText("60")
        lux_customizer._change_options()
        assert lux_customizer.options.haltspp == 0
        assert lux_customizer.options.halttime == 60
        lux_customizer.gui.ui.haltTimeLineEdit.setText("XYZ")
        with self.assertLogs(logger, level="ERROR"):
            lux_customizer._change_options()
        assert lux_customizer.options.haltspp == 0
        lux_customizer.gui.ui.stopBySppRadioButton.setChecked(True)
        lux_customizer.gui.ui.haltTimeLineEdit.setText("30")
        lux_customizer.gui.ui.haltSppLineEdit.setText("ABC")
        with self.assertLogs(logger, level="ERROR"):
            lux_customizer._change_options()
        assert lux_customizer.options.halttime == 0
        lux_customizer.gui.ui.haltSppLineEdit.setText("25")
        lux_customizer._change_options()
        assert lux_customizer.options.halttime == 0
        assert lux_customizer.options.haltspp == 25

        lux_customizer.options.haltspp = 0
        lux_customizer._change_halts_values()
        assert lux_customizer.gui.ui.stopByTimeRadioButton.isChecked()
        assert not lux_customizer.gui.ui.stopBySppRadioButton.isChecked()
        lux_customizer.options.haltspp = 24
        lux_customizer._change_halts_values()
        assert not lux_customizer.gui.ui.stopByTimeRadioButton.isChecked()
        assert lux_customizer.gui.ui.stopBySppRadioButton.isChecked()
    def test_table(self):
        customizer = MainWindowCustomizer(self.gui.get_main_window(),
                                          MagicMock())
        task1 = TaskDesc()
        task1.definition.task_id = "TASK ID 1"
        task1.status = "Finished"
        task1.definition.task_name = "TASK NAME 1"
        customizer.logic.get_task.return_value = task1
        customizer.add_task(task1)
        assert customizer.gui.ui.taskTableWidget.item(
            0, ItemMap.Id).text() == "TASK ID 1"
        assert customizer.gui.ui.taskTableWidget.item(
            0, ItemMap.Name).text() == "TASK NAME 1"
        assert customizer.gui.ui.taskTableWidget.item(
            0, ItemMap.Status).text() == "Finished"
        assert customizer.gui.ui.taskTableWidget.item(
            0, ItemMap.Cost).text() == "0.000000"
        assert customizer.gui.ui.taskTableWidget.item(
            0, ItemMap.Time).text() == "00:00:00"
        task2 = TaskDesc()
        task2.definition.task_id = "TASK ID 2"
        task2.status = "Waiting"
        task2.definition.task_name = "TASK NAME 2"
        customizer.logic.get_task.return_value = task2
        customizer.add_task(task2)
        assert customizer.gui.ui.taskTableWidget.item(
            1, ItemMap.Id).text() == "TASK ID 2"
        assert customizer.gui.ui.taskTableWidget.item(
            1, ItemMap.Name).text() == "TASK NAME 2"
        assert customizer.gui.ui.taskTableWidget.item(
            1, ItemMap.Status).text() == "Waiting"
        assert customizer.gui.ui.taskTableWidget.item(
            1, ItemMap.Cost).text() == "0.000000"
        assert customizer.gui.ui.taskTableWidget.item(
            1, ItemMap.Time).text() == "00:00:00"
        customizer.update_time()
        assert customizer.gui.ui.taskTableWidget.item(
            0, ItemMap.Time).text() == "00:00:00"
        time_ = customizer.gui.ui.taskTableWidget.item(1, ItemMap.Time).text()
        assert time_ != "00:00:00"
        task1.task_state.status = "Computing"
        task2.task_state.progress = 0.3
        task2.task_state.status = "Paused"
        task2.task_state.progress = 1.0
        customizer.logic.get_cost_for_task_id.return_value = 2.342 * denoms.ether
        tasks = {'TASK ID 1': task1, 'TASK ID 2': task2}
        customizer.update_tasks(tasks)
        customizer.update_time()
        assert customizer.gui.ui.taskTableWidget.item(
            1, ItemMap.Cost).text() == "2.342000"
        assert customizer.gui.ui.taskTableWidget.item(
            0, ItemMap.Time).text() != "00:00:00"
        assert customizer.gui.ui.taskTableWidget.item(
            1, ItemMap.Time).text() == time_
        customizer.remove_task("TASK ID 2")

        customizer.logic.get_task.return_value = TaskDesc()
        customizer.show_change_task_dialog("ABC")
        customizer.change_task_dialog.close()
Beispiel #12
0
    def test_run_test_task(self, *_):
        logic = self.logic
        gui = self.app

        rpc_session = MockRPCSession(self.client, CORE_METHOD_MAP)
        rpc_client = rpc.session.Client(rpc_session, CORE_METHOD_MAP)
        rpc_publisher = MockRPCPublisher()

        logic.root_path = self.path
        logic.client = rpc_client

        self.client.datadir = logic.root_path
        self.client.rpc_publisher = rpc_publisher

        logic.customizer = MainWindowCustomizer(gui.main_window, logic)
        logic.customizer.new_task_dialog_customizer = Mock()
        logic.customizer.show_warning_window = Mock()

        ts = TaskDesc()
        files = self.additional_dir_content([1])
        ts.definition.main_program_file = files[0]
        ts.definition.task_type = "TESTTASK"
        f = self.additional_dir_content([2])
        ts.definition.output_file = f[0]
        ts.definition.main_scene_file = f[1]  # FIXME Remove me

        task_type = Mock()
        ttb = TTaskBuilder(self.path)
        task_type.task_builder_type.return_value = ttb
        logic.task_types["TESTTASK"] = task_type

        rpc_publisher.reset()
        sync_wait(logic.run_test_task(ts))
        logic.progress_dialog.close()
        logic.test_task_started(True)
        self.assertTrue(
            logic.progress_dialog_customizer.gui.ui.abortButton.isEnabled())
        time.sleep(0.5)
        self.assertTrue(rpc_publisher.success)

        ttb.src_code = "import time\ntime.sleep(0.1)\n" \
                       "output = {'data': n, 'result_type': 0}"
        rpc_publisher.reset()
        sync_wait(logic.run_test_task(ts))
        logic.progress_dialog.close()
        time.sleep(0.5)
        self.assertTrue(rpc_publisher.success)

        # since PythonTestVM does not support end_comp() method,
        # this is only a smoke test instead of actual test
        ttb.src_code = "import time\ntime.sleep(0.1)\n" \
                       "output = {'data': n, 'result_type': 0}"
        rpc_publisher.reset()
        sync_wait(logic.run_test_task(ts))
        logic.progress_dialog.close()
        time.sleep(0.5)
        logic.abort_test_task()

        ttb.src_code = "raise Exception('some error')"
        rpc_publisher.reset()
        sync_wait(logic.run_test_task(ts))
        logic.progress_dialog.close()
        time.sleep(1)
        self.assertFalse(rpc_publisher.success)

        rpc_publisher.reset()
        sync_wait(logic.run_test_task(ts))
        logic.progress_dialog.close()
        self.assertFalse(rpc_publisher.success)

        ctr = logic.customizer.new_task_dialog_customizer
        prev_call_count = ctr.task_settings_changed.call_count
        logic.task_settings_changed()
        self.assertGreater(ctr.task_settings_changed.call_count,
                           prev_call_count)

        logic.tasks["xyz"] = ts
        logic.clone_task("xyz")

        self.assertEqual(
            logic.customizer.new_task_dialog_customizer.load_task_definition.
            call_args[0][0], ts.definition)

        ttb = TTaskBuilder(self.path, TTaskWithDef)
        logic.task_types["TESTTASK"].task_builder_type.return_value = ttb
        assert sync_wait(logic.run_test_task(ts))

        ttb = TTaskBuilder(self.path, TTaskWithError)
        logic.task_types["TESTTASK"].task_builder_type.return_value = ttb
        assert not sync_wait(logic.run_test_task(ts))
Beispiel #13
0
    def test_messages(self, msg_box):
        msg_box.return_value = msg_box
        logic = self.logic
        self.logic.datadir = self.path
        logic.customizer = MainWindowCustomizer(self.app.main_window, logic)
        logic.customizer.show_error_window = Mock()
        logic.customizer.show_warning_window = Mock()
        logic.customizer.current_task_highlighted = Mock()
        logic.client = Mock()
        self.logic.dir_manager = DirManager(self.path)
        register_task_types(logic)

        rts = TaskDesc()
        self.assertIsInstance(rts, TaskDesc)
        f = self.additional_dir_content([3])
        rts.definition.task_type = "Blender"
        rts.definition.output_file = f[0]
        rts.definition.main_program_file = f[1]
        rts.definition.main_scene_file = f[2]
        self.assertTrue(logic._validate_task_state(rts))
        m = Mock()

        broken_benchmark = BlenderBenchmark()
        broken_benchmark.task_definition.main_program_file = u'Bździągwa'
        logic.customizer.show_error_window = Mock()
        logic.run_benchmark(broken_benchmark, m, m)
        logic.progress_dialog.close()
        if logic.br.tt:
            logic.br.tt.join()
        logic.customizer.show_error_window.assert_called_with(
            u"Main program file does not exist: Bździągwa")

        broken_benchmark = BlenderBenchmark()
        broken_benchmark.task_definition.output_file = u'/x/y/Bździągwa'
        logic.run_benchmark(broken_benchmark, m, m)
        logic.progress_dialog.close()
        if logic.br.tt:
            logic.br.tt.join()
        logic.customizer.show_error_window.assert_called_with(
            u"Cannot open output file: /x/y/Bździągwa")

        broken_benchmark = BlenderBenchmark()
        broken_benchmark.task_definition.main_scene_file = "NOT EXISTING"
        output_file = os.path.join(self.path, str(uuid.uuid4()))
        broken_benchmark.task_definition.output_file = output_file
        logic.run_benchmark(broken_benchmark, m, m)
        logic.progress_dialog.close()
        if logic.br.tt:
            logic.br.tt.join()
        logic.customizer.show_error_window.assert_called_with(
            u"Main scene file NOT EXISTING is not properly set")

        logic.test_task_computation_error(u"Bździągwa")
        text = logic.progress_dialog_customizer.gui.ui.message.text()
        assert text == u"Task test computation failure. Bździągwa"
        logic.test_task_computation_error(u"500 server error")
        text = logic.progress_dialog_customizer.gui.ui.message.text()
        assert text == u"Task test computation failure. [500 server error] " \
            u"There is a chance that you RAM limit is too low. " \
            u"Consider increasing max memory usage"
        logic.test_task_computation_error(None)
        text = logic.progress_dialog_customizer.gui.ui.message.text()
        assert text == u"Task test computation failure. "
        logic.test_task_computation_success([], 10000, 1021, {})
        text = logic.progress_dialog_customizer.gui.ui.message.text()
        assert text.startswith(u"Task tested successfully")
        logic.test_task_computation_success([], 10000, 1021,
                                            {"warnings": "Warning message"})
        text = logic.progress_dialog_customizer.gui.ui.message.text()
        assert text.startswith(u"Task tested successfully")
        logic.customizer.show_warning_window.assert_called_with(
            "Warning message")

        rts.definition = BlenderBenchmark().task_definition
        rts.definition.output_file = 1342
        self.assertFalse(logic._validate_task_state(rts))

        self.assertEqual(logic._format_stats_message(("STAT1", 2424)),
                         u"Session: STAT1; All time: 2424")
        self.assertEqual(logic._format_stats_message(["STAT1"]), u"Error")
        self.assertEqual(logic._format_stats_message(13131), u"Error")

        ts = TaskDesc()
        ts.definition.task_type = "Blender"
        ts.definition.main_program_file = "nonexisting"
        self.assertFalse(logic._validate_task_state(ts))
        logic.customizer.show_error_window.assert_called_with(
            u"Main program file does not exist: nonexisting")

        with self.assertLogs(logger, level="WARNING"):
            logic.set_current_task_type("unknown task")

        def query_task_state(*_):
            deferred = Deferred()
            deferred.callback(True)
            return deferred

        logic.client.query_task_state = query_task_state
        with self.assertLogs(logger, level="WARNING"):
            logic.task_status_changed("unknown id")

        task_type = Mock()
        task_type.name = "NAME1"
        logic.register_new_task_type(task_type)
        with self.assertLogs(int_logger, level="ERROR"):
            logic.register_new_task_type(task_type)

        logic.register_new_test_task_type(task_type)
        with self.assertRaises(RuntimeError):
            logic.register_new_test_task_type(task_type)