def build_unit_test_command(self, test_filename): self.command_list.extend([ CommandData(self.create_java_compile_command(test_filename), CommandType.COMPILE), CommandData(self.create_java_run_command(test_filename), CommandType.RUN) ])
def build_delete_command(self, test_filename, exercise_filename): self.command_list.extend([ CommandData(self.get_safe_delete_command(C_COMPILED_FILENAME), CommandType.DELETE), CommandData(self.get_safe_delete_command(test_filename), CommandType.DELETE) ])
def build_delete_command(self, test_filename, exercise_filename): self.command_list.extend([ CommandData( self.get_safe_delete_command("*." + PY_BYTECODE_EXTENSION), CommandType.DELETE), CommandData(self.get_safe_delete_command(PY_BYTECODE_FOLDER), CommandType.DELETE), CommandData(self.get_safe_delete_command(test_filename), CommandType.DELETE) ])
def build_delete_command(self, test_filename, exercise_filename): exercise_filename = exercise_filename.split(".")[0] test_filename_without_ext = test_filename.split(".")[0] self.command_list.extend([ CommandData( self.get_safe_delete_command(exercise_filename + ".class"), CommandType.DELETE), CommandData(self.get_safe_delete_command(test_filename), CommandType.DELETE), CommandData( self.get_safe_delete_command(test_filename_without_ext + ".class"), CommandType.DELETE) ])
def check_environment(language): command = CommandData(get_command(language)) try: returncode = run_single_command(command).returncode if "javascript" == language and check_tape_for_js(): user_presenter.env_not_found(language) except FileNotFoundError: user_presenter.env_not_found(language) else: if returncode != 0: user_presenter.env_not_found(language)
def regex_run_builder(self, requirements, run_command_creator, run_command_parameters=None): self.logger.debug("Build run command for regex test") input_list = self.regex_test_data_collect( requirements, REGEX_TEST_INPUT_FIELD_NAME) output_list = self.regex_test_data_collect( requirements, REGEX_TEST_OUPUT_FIELD_NAME) for index, regex in enumerate(output_list): if len(input_list) == index: input_list.append(None) self.command_list.append(CommandData( run_command_creator() if run_command_parameters is None else run_command_creator(*run_command_parameters), CommandType.RUN, input_list[index], regex))
def build_regex_test_command(self, exercise_filename, requirements): self.command_list.append( CommandData(self.create_c_compile_command(exercise_filename), CommandType.COMPILE)) self.regex_run_builder(requirements, self.create_c_run_command)
def build_unit_test_command(self, test_filename): self.command_list.append( CommandData(self.create_py_run_command(test_filename), CommandType.RUN))
def build_delete_command(self, test_filename, exercise_filename): self.command_list.append( CommandData(self.get_safe_delete_command(test_filename), CommandType.DELETE))