Ejemplo n.º 1
0
 def test_renderer_for_instruction_with_including_name(self):
     request = sut.TestSuiteHelpRequest(TestSuiteHelpItem.INSTRUCTION,
                                        'name',
                                        instruction_documentation('name'),
                                        True)
     self._check_resolver_gives_renderer_that_produces_section_contents(
         request)
Ejemplo n.º 2
0
def instruction_setup_with_single_phase_with_single_recording_instruction(
        name_of_registering_instruction: str,
        recording_media: List[Recording],
        mk_instruction_with_main_action: Callable[[Callable], Instruction],
        mk_instruction_set_for_single_phase: Callable[[Dict[str, SingleInstructionSetup]], InstructionsSetup],
) -> InstructionsSetup:
    instruction_setup = SingleInstructionSetup(
        InstructionParserForRecordingInstructions(recording_media,
                                                  mk_instruction_with_main_action),
        instruction_documentation('name-of-instruction'))

    phase_instructions = {
        name_of_registering_instruction: instruction_setup
    }

    return mk_instruction_set_for_single_phase(phase_instructions)
def instruction_setup_with_single_phase_with_single_recording_instruction(
        name_of_registering_instruction: str,
        recording_media: List[Recording],
        mk_instruction_with_main_action: Callable[[Callable], Instruction],
        mk_instruction_set_for_single_phase: Callable[[Dict[str, SingleInstructionSetup]], InstructionsSetup],
) -> InstructionsSetup:
    instruction_setup = SingleInstructionSetup(
        InstructionParserForRecordingInstructions(recording_media,
                                                  mk_instruction_with_main_action),
        instruction_documentation('name-of-instruction'))

    phase_instructions = {
        name_of_registering_instruction: instruction_setup
    }

    return mk_instruction_set_for_single_phase(phase_instructions)
Ejemplo n.º 4
0
def instruction_setup(setup_phase_instructions: Dict[str, InstructionParser]) -> InstructionsSetup:
    return InstructionsSetup({},
                             {name: SingleInstructionSetup(parser,
                                                           instruction_documentation('name-of-instruction'))
                              for name, parser in setup_phase_instructions.items()},
                             {}, {}, {})
Ejemplo n.º 5
0
 def test_renderer_for_instruction_with_including_name(self):
     request = sut.TestCaseHelpRequest(TestCaseHelpItem.INSTRUCTION,
                                       'name',
                                       instruction_documentation('name'),
                                       True)
     self._check_resolver_gives_renderer_that_produces_section_contents(request)
Ejemplo n.º 6
0
def recording_instruction_setup(recorder: List[Recording]) -> SingleInstructionSetup:
    return SingleInstructionSetup(InstructionParserForRecordingInstructions(recorder,
                                                                            mk_setup_phase_recording_instruction),
                                  instruction_documentation('name-of-instruction'))
Ejemplo n.º 7
0
def instruction_setup(setup_phase_instructions: Dict[str, InstructionParser]) -> InstructionsSetup:
    return InstructionsSetup({},
                             {name: SingleInstructionSetup(parser,
                                                           instruction_documentation('name-of-instruction'))
                              for name, parser in setup_phase_instructions.items()},
                             {}, {}, {})
def recording_instruction_setup(recorder: List[Recording]) -> SingleInstructionSetup:
    return SingleInstructionSetup(InstructionParserForRecordingInstructions(recorder,
                                                                            mk_setup_phase_recording_instruction),
                                  instruction_documentation('name-of-instruction'))
Ejemplo n.º 9
0
def single_instruction_setup_for_parser(
        instruction_name: str,
        parser: InstructionParser) -> SingleInstructionSetup:
    return SingleInstructionSetup(
        parser, instr_doc.instruction_documentation(instruction_name))
Ejemplo n.º 10
0
def instr_setup(instruction: Instruction) -> SingleInstructionSetup:
    return SingleInstructionSetup(
        parser=ParserThatGives(instruction),
        documentation=instruction_documentation('instruction name'),
    )
Ejemplo n.º 11
0
def single_instruction_setup_for_parser(instruction_name: str,
                                        parser: InstructionParser) -> SingleInstructionSetup:
    return SingleInstructionSetup(parser,
                                  instr_doc.instruction_documentation(instruction_name))
Ejemplo n.º 12
0
def instr_setup(instruction: Instruction) -> SingleInstructionSetup:
    return SingleInstructionSetup(
        parser=ParserThatGives(instruction),
        documentation=instruction_documentation('instruction name'),
    )
Ejemplo n.º 13
0
def _setup_hard_error_conf_phase_instruction(
        instruction_name: str) -> SingleInstructionSetup:
    return SingleInstructionSetup(
        _ParserOfConfPhaseInstructionThatCausesHardError(),
        instruction_documentation.instruction_documentation(instruction_name),
    )
Ejemplo n.º 14
0
def _setup_for_actor_that_parses_references(
        instruction_name: str) -> SingleInstructionSetup:
    return SingleInstructionSetup(
        _SetActorThatParsesReferences(),
        instruction_documentation.instruction_documentation(instruction_name),
    )