Ejemplo n.º 1
0
    def __init__(self, name: str):
        super().__init__(name)
        self._tp = TextParser({
            'program_name': program_info.PROGRAM_NAME,
            'phase': phase_names.PHASE_NAME_DICTIONARY,
            'setup': phase_infos.SETUP.name,
            'act': phase_infos.ACT.name,
            'action_to_check': concepts.ACTION_TO_CHECK_CONCEPT_INFO.name,
            'home_directory': formatting.conf_param_(conf_params.HDS_CASE_DIRECTORY_CONF_PARAM_INFO),
            'sandbox': formatting.concept_(concepts.SDS_CONCEPT_INFO),
            'result_dir': tc_fs.SDS_RESULT_INFO.identifier,
            'actor_option': OPTION_FOR_ACTOR,
            'actor': concepts.ACTOR_CONCEPT_INFO.name,
            'actor_instruction': formatting.InstructionName(ACTOR_INSTRUCTION_NAME),
            'default_actor': actors.DEFAULT_ACTOR_SINGLE_LINE_VALUE,
            'null_actor': formatting.entity_(actors.NULL_ACTOR),
            'os_process': misc_texts.OS_PROCESS_NAME,
            'instruction': concepts.INSTRUCTION_CONCEPT_INFO.name,
            'stdin_instruction': InstructionName(instruction_names.CONTENTS_OF_STDIN_INSTRUCTION_NAME),
            'env_instruction': InstructionName(instruction_names.ENV_VAR_INSTRUCTION_NAME),
            'timeout': concepts.TIMEOUT_CONCEPT_INFO.name,
            'timeout_default': concepts.TIMEOUT_CONCEPT_INFO.default,
            'timeout_instruction': InstructionName(instruction_names.TIMEOUT_INSTRUCTION_NAME),
            'conf_param': concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.name,
            'env_var': concepts.ENVIRONMENT_VARIABLE_CONCEPT_INFO.name,
            'PROGRAM': syntax_elements.PROGRAM_SYNTAX_ELEMENT.singular_name,
            'stdin': misc_texts.STDIN,

            'directive': concepts.DIRECTIVE_CONCEPT_INFO.name,
            'including': formatting.keyword(directives.INCLUDING_DIRECTIVE_INFO.singular_name),

        })
Ejemplo n.º 2
0
 def __init__(self,
              name: str,
              conf_param: ConfigurationParameterInfo):
     self.conf_param = conf_param
     super().__init__(name, {
         'conf_param': formatting.conf_param_(conf_param),
         'DIR': _DIR_ARG.name,
     })
Ejemplo n.º 3
0
 def __init__(self,
              name: str,
              instruction_set: SectionInstructionSet):
     super().__init__(name, instruction_set)
     self._tp = TextParser({
         'phase': phase_names.PHASE_NAME_DICTIONARY,
         'SKIP': NAME_SKIP,
         'execution_mode': formatting.conf_param_(conf_params.TEST_CASE_STATUS_CONF_PARAM_INFO),
         'ATC': formatting.concept_(concepts.ACTION_TO_CHECK_CONCEPT_INFO),
     })
Ejemplo n.º 4
0
 def purpose(self) -> DescriptionWithSubSections:
     parser = TextParser({
         'phase': phase_names.PHASE_NAME_DICTIONARY,
         'the_concept': formatting.conf_param_(conf_params.HOME_ACT_DIRECTORY_CONF_PARAM_INFO),
         'home_dir_env_var': ENV_VAR_HOME_ACT,
         'rel_option': formatting.cli_option(REL_HOME_ACT_OPTION)
     })
     return from_simple_description(
         Description(self.single_line_description(),
                     parser.fnap(_REST_DESCRIPTION)))
Ejemplo n.º 5
0
    def __init__(self,
                 name: str,
                 instruction_set: SectionInstructionSet):
        super().__init__(name, instruction_set)

        self._parser = TextParser({
            'configuration_parameters': formatting.concept(concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.plural_name),
            'execution_mode': formatting.conf_param_(conf_params.TEST_CASE_STATUS_CONF_PARAM_INFO),
            'SKIP': NAME_SKIP,
            'setup': phase_names.SETUP,
        })
Ejemplo n.º 6
0
 def __init__(self, name: str, instruction_set: SectionInstructionSet):
     super().__init__(name, instruction_set)
     self._tp = TextParser({
         'phase':
         phase_names.PHASE_NAME_DICTIONARY,
         'SKIP':
         NAME_SKIP,
         'execution_mode':
         formatting.conf_param_(
             conf_params.TEST_CASE_STATUS_CONF_PARAM_INFO),
         'ATC':
         formatting.concept_(concepts.ACTION_TO_CHECK_CONCEPT_INFO),
     })
Ejemplo n.º 7
0
 def __init__(self):
     self.text_parser = TextParser({
         'program_name': formatting.program_name(program_info.PROGRAM_NAME),
         'case_home_directory': formatting.conf_param_(conf_params.HOME_CASE_DIRECTORY_CONF_PARAM_INFO),
         'act_home_directory': formatting.concept_(conf_params.HOME_ACT_DIRECTORY_CONF_PARAM_INFO),
         'act_sub_dir': sds.SUB_DIRECTORY__ACT,
         'tmp_sub_dir': sds.PATH__TMP_USER,
         'result_sub_dir': sds.SUB_DIRECTORY__RESULT,
         'sandbox': concepts.SANDBOX_CONCEPT_INFO.name,
         'conf_param': concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.name,
     }
     )
     self.all_variables_dict = dict(ENVIRONMENT_VARIABLES_SET_BEFORE_ACT + ENVIRONMENT_VARIABLES_SET_AFTER_ACT)
Ejemplo n.º 8
0
 def purpose(self) -> DescriptionWithSubSections:
     parse = TextParser({
         'action_to_check': formatting.concept_(concepts.ACTION_TO_CHECK_CONCEPT_INFO),
         'actor': self.name(),
         'actor_option': formatting.cli_option(common_cli_options.OPTION_FOR_ACTOR),
         'actor_instruction': formatting.InstructionName(instruction_names.ACTOR_INSTRUCTION_NAME),
         'act': phase_infos.ACT.name,
         'default_actor': actors.DEFAULT_ACTOR_SINGLE_LINE_VALUE,
         'actor_conf_param': formatting.conf_param_(conf_params.ACTOR_CONF_PARAM_INFO),
         'conf_param': concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.name,
     })
     contents = parse.fnap(_AFTER_SINGLE_LINE_DESCRIPTION)
     return DescriptionWithSubSections(self.single_line_description(),
                                       docs.section_contents(contents))
Ejemplo n.º 9
0
    def __init__(self, name: str, instruction_set: SectionInstructionSet):
        super().__init__(name, instruction_set)

        self._parser = TextParser({
            'configuration_parameters':
            formatting.concept(
                concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.plural_name),
            'execution_mode':
            formatting.conf_param_(
                conf_params.TEST_CASE_STATUS_CONF_PARAM_INFO),
            'SKIP':
            NAME_SKIP,
            'setup':
            phase_names.SETUP,
        })
Ejemplo n.º 10
0
    def __init__(self, name: str):
        super().__init__(name)
        self._tp = TextParser({
            'phase': phase_names.PHASE_NAME_DICTIONARY,
            'setup': phase_infos.SETUP.name,
            'action_to_check': concepts.ACTION_TO_CHECK_CONCEPT_INFO.name,
            'home_directory': formatting.conf_param_(conf_params.HOME_CASE_DIRECTORY_CONF_PARAM_INFO),
            'timeout_conf_param': formatting.conf_param_(conf_params.TIMEOUT_CONF_PARAM_INFO),
            'sandbox': formatting.concept_(concepts.SANDBOX_CONCEPT_INFO),
            'result_dir': tc_fs.SDS_RESULT_INFO.identifier,
            'actor_option': OPTION_FOR_ACTOR,
            'actor': concepts.ACTOR_CONCEPT_INFO.name,
            'actor_instruction': formatting.InstructionName(ACTOR_INSTRUCTION_NAME),
            'default_actor': actors.DEFAULT_ACTOR_SINGLE_LINE_VALUE,
            'null_actor': formatting.entity_(actors.NULL_ACTOR),
            'os_process': misc_texts.OS_PROCESS_NAME,
            'act': phase_infos.ACT.name,
            'stdin_instruction': InstructionName(instruction_names.CONTENTS_OF_STDIN_INSTRUCTION_NAME),
            'conf_param': concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.name,

            'directive': concepts.DIRECTIVE_CONCEPT_INFO.name,
            'including': formatting.keyword(directives.INCLUDING_DIRECTIVE_INFO.singular_name),

        })
Ejemplo n.º 11
0
    def _contents(self) -> Sequence[ParagraphItem]:
        tp = TextParser({
            'action_to_check': formatting.concept_(concepts.ACTION_TO_CHECK_CONCEPT_INFO),
            'actor': self.name(),
            'actor_option': formatting.cli_option(common_cli_options.OPTION_FOR_ACTOR),
            'actor_instruction': formatting.InstructionName(instruction_names.ACTOR_INSTRUCTION_NAME),
            'act': phase_infos.ACT.name,
            'default_actor': actors.DEFAULT_ACTOR_SINGLE_LINE_VALUE,
            'null_actor': formatting.entity(actors.NULL_ACTOR.singular_name),
            'actor_conf_param': formatting.conf_param_(conf_params.ACTOR_CONF_PARAM_INFO),
            'conf_param': concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.name,
            'space': misc_texts.WHITESPACE,
        })
        ret_val = list(tp.fnap(_AFTER_SLD__BEFORE_EXAMPLES))
        ret_val += atc.atc_examples()
        ret_val += tp.fnap(_AFTER_SLD__AFTER_EXAMPLES)

        return ret_val
Ejemplo n.º 12
0
 def purpose(self) -> DescriptionWithSubSections:
     parser = TextParser({
         'phase':
         phase_names.PHASE_NAME_DICTIONARY,
         'the_concept':
         formatting.conf_param_(HDS_CASE_DIRECTORY_CONF_PARAM_INFO),
         'instruction':
         concepts.INSTRUCTION_CONCEPT_INFO.name,
         'dir_symbol':
         tcds_symbols.SYMBOL_HDS_CASE,
         'rel_option':
         formatting.cli_option(REL_HDS_CASE_OPTION),
         'symbol':
         concepts.SYMBOL_CONCEPT_INFO.name,
     })
     return from_simple_description(
         Description(self.single_line_description(),
                     parser.fnap(_REST_DESCRIPTION)))
Ejemplo n.º 13
0
 def __init__(self):
     self.text_parser = TextParser({
         'program_name':
         formatting.program_name(program_info.PROGRAM_NAME),
         'hds_case_directory':
         formatting.conf_param_(
             conf_params.HDS_CASE_DIRECTORY_CONF_PARAM_INFO),
         'hds_act_directory':
         formatting.concept_(conf_params.HDS_ACT_DIRECTORY_CONF_PARAM_INFO),
         'act_sub_dir':
         sds.SUB_DIRECTORY__ACT,
         'tmp_sub_dir':
         sds.PATH__TMP_USER,
         'result_sub_dir':
         sds.SUB_DIRECTORY__RESULT,
         'sandbox':
         concepts.SDS_CONCEPT_INFO.name,
         'conf_param':
         concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO.name,
     })
     self.all_variables_dict = dict(SYMBOLS_SET_BEFORE_ACT +
                                    SYMBOLS_SET_AFTER_ACT)
Ejemplo n.º 14
0
from exactly_lib.tcfs.tcds_symbols import SYMBOL_RESULT
from exactly_lib.test_case.test_case_status import NAME_SKIP
from exactly_lib.util.textformat.structure import structures as docs, table
from exactly_lib.util.textformat.structure.core import ParagraphItem
from exactly_lib.util.textformat.structure.table import TableCell
from exactly_lib.util.textformat.textformat_parser import TextParser

_TEXT_PARSER = TextParser({
    'instruction':
    concepts.INSTRUCTION_CONCEPT_INFO.name,
    'act_dir':
    test_case_file_structure.SDS_ACT_INFO.identifier,
    'cwd':
    formatting.concept_(concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO),
    'execution_mode':
    formatting.conf_param_(conf_params.TEST_CASE_STATUS_CONF_PARAM_INFO),
    'SKIP':
    NAME_SKIP,
    'result_subdir':
    sds.SUB_DIRECTORY__RESULT,
    'sandbox':
    formatting.concept_(concepts.SDS_CONCEPT_INFO),
    'SYMBOL_RESULT':
    SYMBOL_RESULT,
    'phase':
    PHASE_NAME_DICTIONARY,
    'ATC':
    formatting.concept_(concepts.ACTION_TO_CHECK_CONCEPT_INFO),
    'SYMBOL':
    formatting.concept_(concepts.SYMBOL_CONCEPT_INFO),
    'env_var':
Ejemplo n.º 15
0
from exactly_lib.definitions.doc_format import file_name_text
from exactly_lib.definitions.entity import concepts, conf_params
from exactly_lib.definitions.formatting import SectionName
from exactly_lib.definitions.test_case.phase_names import PHASE_NAME_DICTIONARY
from exactly_lib.test_case.test_case_status import NAME_SKIP
from exactly_lib.test_case_file_structure import sandbox_directory_structure as sds, environment_variables
from exactly_lib.test_case_file_structure.environment_variables import ENV_VAR_RESULT
from exactly_lib.util.textformat.structure import structures as docs, table
from exactly_lib.util.textformat.structure.core import ParagraphItem
from exactly_lib.util.textformat.structure.table import TableCell
from exactly_lib.util.textformat.textformat_parser import TextParser

_TEXT_PARSER = TextParser({
    'act_dir': test_case_file_structure.SDS_ACT_INFO.identifier,
    'cwd': formatting.concept_(concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO),
    'execution_mode': formatting.conf_param_(conf_params.TEST_CASE_STATUS_CONF_PARAM_INFO),
    'SKIP': NAME_SKIP,
    'result_subdir': sds.SUB_DIRECTORY__RESULT,
    'sandbox': formatting.concept_(concepts.SANDBOX_CONCEPT_INFO),
    'ENV_VAR_RESULT': ENV_VAR_RESULT,
    'phase': PHASE_NAME_DICTIONARY,
    'ATC': formatting.concept_(concepts.ACTION_TO_CHECK_CONCEPT_INFO)
})


def cwd_at_start_of_phase_for_configuration_phase() -> List[ParagraphItem]:
    return []


def cwd_at_start_of_phase_first_phase_executed_in_the_sandbox() -> List[ParagraphItem]:
    return _TEXT_PARSER.fnap(_CWD_AT_START_OF_PHASE_FIRST_PHASE_EXECUTED_IN_THE_SANDBOX)
Ejemplo n.º 16
0
def root(header: str) -> generator.SectionHierarchyGenerator:
    tp = TextParser({

        'program_name': formatting.program_name(program_info.PROGRAM_NAME),
        'conf_param': formatting.concept_(concepts.CONFIGURATION_PARAMETER_CONCEPT_INFO),

        'tcds_concept': formatting.concept_(concepts.TEST_CASE_DIRECTORY_STRUCTURE_CONCEPT_INFO),
        'TCDS': concepts.TEST_CASE_DIRECTORY_STRUCTURE_CONCEPT_INFO.acronym,

        'SDS': concepts.SANDBOX_CONCEPT_INFO.acronym,
        'sds_concept': formatting.concept_(concepts.SANDBOX_CONCEPT_INFO),
        'Sds_concept_header': concepts.SANDBOX_CONCEPT_INFO.singular_name.capitalize(),
        'sds_single_line_description':
            concepts.SANDBOX_CONCEPT_INFO.single_line_description_str.capitalize(),

        'HDS': concepts.HOME_DIRECTORY_STRUCTURE_CONCEPT_INFO.acronym,
        'hds_concept': formatting.concept_(concepts.HOME_DIRECTORY_STRUCTURE_CONCEPT_INFO),
        'Hds_concept_header': concepts.HOME_DIRECTORY_STRUCTURE_CONCEPT_INFO.singular_name.capitalize(),
        'hds_single_line_description':
            concepts.HOME_DIRECTORY_STRUCTURE_CONCEPT_INFO.single_line_description_str.capitalize(),

        'conf_phase': phase_names.CONFIGURATION,
        'act_phase': phase_names.ACT,

        'act_home_conf_param': formatting.conf_param(test_case_file_structure.HDS_ACT_INFO.identifier),

        'data': type_system.DATA_TYPE_CATEGORY_NAME,
        'path_type': formatting.term(types.PATH_TYPE_INFO.singular_name),

        'symbol_concept': formatting.concept_(concepts.SYMBOL_CONCEPT_INFO),
        'def_instruction': InstructionName(instruction_names.SYMBOL_DEFINITION_INSTRUCTION_NAME),

        'os_process': misc_texts.OS_PROCESS_NAME,
        'time_out_conf_param': formatting.conf_param_(conf_params.TIMEOUT_CONF_PARAM_INFO),

        'relativity': formatting.concept(misc_texts.RELATIVITY.singular),
        'relativities': formatting.concept(misc_texts.RELATIVITY.plural),

        'cd': formatting.emphasis(instruction_names.CHANGE_DIR_INSTRUCTION_NAME),
        'env': formatting.emphasis(instruction_names.ENV_VAR_INSTRUCTION_NAME),
        'CD': formatting.concept_(concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO),
    })

    def const_paragraphs_child(local_target_name: str,
                               header_: str,
                               paragraphs_: List[ParagraphItem]) -> generator.SectionHierarchyGenerator:
        return h.child(local_target_name,
                       h.leaf(header_,
                              sections.constant_contents(section_contents(paragraphs_)))
                       )

    return h.hierarchy(
        header,
        children=[
            h.child_hierarchy(
                'dir-structure',
                'Directory structure and Current directory',
                paragraphs.constant(tp.fnap(_DS_CD_PREAMBLE)),
                [
                    const_paragraphs_child(
                        'sds',
                        concepts.SANDBOX_CONCEPT_INFO.singular_name.capitalize() +
                        ' and Current directory',
                        tp.fnap(_SDS_AND_CD)
                    ),
                    const_paragraphs_child(
                        'hds',
                        concepts.HOME_DIRECTORY_STRUCTURE_CONCEPT_INFO.singular_name.capitalize(),
                        tp.fnap(_HDS),
                    ),
                    const_paragraphs_child(
                        'file-ref',
                        'File references',
                        tp.fnap(_FILE_REFERENCES)
                    ),
                    h.child('see-also',
                            h.with_not_in_toc(
                                h.leaf(
                                    see_also.SEE_ALSO_TITLE,
                                    see_also.SeeAlsoSectionContentsConstructor(
                                        see_also.items_of_targets(_dir_struct_see_also_targets())
                                    )))
                            ),
                ]
            ),
            h.child_hierarchy(
                'symbols',
                concepts.SYMBOL_CONCEPT_INFO.plural_name.capitalize(),
                paragraphs.constant(tp.fnap(_SYMBOLS)),
                [
                    h.with_not_in_toc(
                        h.child_leaf(
                            'see-also',
                            see_also.SEE_ALSO_TITLE,
                            see_also.SeeAlsoSectionContentsConstructor(
                                see_also.items_of_targets(_symbols_see_also_targets())
                            ))
                    )
                ]
            ),
            h.child_hierarchy(
                'os-proc',
                tp.text('{os_process} environment'),
                paragraphs.constant(tp.fnap(_OS_PROC_INTRO)),
                [
                    const_paragraphs_child(
                        'cd',
                        'Current directory',
                        tp.fnap(_OS_PROC_CURRENT_DIRECTORY),
                    ),
                    const_paragraphs_child(
                        'env-vars',
                        'Environment variables',
                        tp.fnap(_OS_PROC_ENVIRONMENT_VARIABLES),
                    ),
                    const_paragraphs_child(
                        'timeout',
                        'Timeout',
                        tp.fnap(_OS_PROC_TIMEOUT),
                    ),
                    h.with_not_in_toc(
                        h.child_leaf(
                            'see-also',
                            see_also.SEE_ALSO_TITLE,
                            see_also.SeeAlsoSectionContentsConstructor(
                                see_also.items_of_targets(_os_process_see_also_targets())
                            )))
                    ,
                ],
            ),
        ]
    )