本文整理汇总了Python中exactly_lib.util.textformat.textformat_parser.TextParser.section_contents方法的典型用法代码示例。如果您正苦于以下问题:Python TextParser.section_contents方法的具体用法?Python TextParser.section_contents怎么用?Python TextParser.section_contents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类exactly_lib.util.textformat.textformat_parser.TextParser
的用法示例。
在下文中一共展示了TextParser.section_contents方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: ConfigurationSectionDocumentation
# 需要导入模块: from exactly_lib.util.textformat.textformat_parser import TextParser [as 别名]
# 或者: from exactly_lib.util.textformat.textformat_parser.TextParser import section_contents [as 别名]
class ConfigurationSectionDocumentation(TestSuiteSectionDocumentationForSectionWithInstructions):
def __init__(self,
name: str,
instruction_set: SectionInstructionSet):
super().__init__(name, instruction_set)
self._tp = TextParser({
'conf_phase': phase_names.CONFIGURATION,
})
def instructions_section_header(self) -> docs.Text:
return docs.text('Additional instructions')
def instruction_purpose_description(self) -> List[ParagraphItem]:
return []
def contents_description(self) -> docs.SectionContents:
return self._tp.section_contents(_CONTENTS_DESCRIPTION)
def purpose(self) -> Description:
paragraphs = self._tp.fnap(_PURPOSE_REST_TEXT)
paragraphs += test_case_phase_sections.insertion_position_description(self.section_info.name, True)
return Description(self._tp.text(_PURPOSE_SINGLE_LINE_DESCRIPTION_TEXT),
paragraphs)
@property
def see_also_targets(self) -> List[SeeAlsoTarget]:
return [
phase_infos.CONFIGURATION.cross_reference_target
]
示例2: _SectionThatIsIdenticalToTestCasePhase
# 需要导入模块: from exactly_lib.util.textformat.textformat_parser import TextParser [as 别名]
# 或者: from exactly_lib.util.textformat.textformat_parser.TextParser import section_contents [as 别名]
class _SectionThatIsIdenticalToTestCasePhase(TestSuiteSectionDocumentationBaseForSectionWithoutInstructions):
def __init__(self,
phase_name: str,
contents_is_inserted_before_case_contents: bool):
super().__init__(phase_name)
self._contents_is_inserted_before_case_contents = contents_is_inserted_before_case_contents
self._tp = TextParser({
'phase': self.section_info.name,
})
def contents_description(self) -> SectionContents:
return self._tp.section_contents(_CONTENTS_DESCRIPTION)
def purpose(self) -> Description:
paragraphs = self._tp.fnap(_CORRESPONDENCE_DESCRIPTION)
paragraphs += insertion_position_description(self.section_info.name,
self._contents_is_inserted_before_case_contents)
return Description(self._tp.text(_SINGLE_LINE_DESCRIPTION),
paragraphs)
@property
def see_also_targets(self) -> List[SeeAlsoTarget]:
return [
TestCasePhaseCrossReference(self.name.plain)
]
示例3: path_type_path_rendering
# 需要导入模块: from exactly_lib.util.textformat.textformat_parser import TextParser [as 别名]
# 或者: from exactly_lib.util.textformat.textformat_parser.TextParser import section_contents [as 别名]
def path_type_path_rendering() -> SectionItem:
tp = TextParser({
'current_directory_concept': formatting.concept_(concepts.CURRENT_WORKING_DIRECTORY_CONCEPT_INFO),
'def_instruction': InstructionName(instruction_names.SYMBOL_DEFINITION_INSTRUCTION_NAME),
'symbol_concept': formatting.concept(concepts.SYMBOL_CONCEPT_INFO.singular_name),
'rel_cd_option': formatting.cli_option(file_ref.REL_CWD_OPTION),
'path_type': formatting.keyword(types.PATH_TYPE_INFO.name.singular),
})
return Section(tp.text(_PATH_TYPE_PATH_RENDERING_DESCRIPTION_HEADER),
tp.section_contents(_PATH_TYPE_PATH_RENDERING_DESCRIPTION))
示例4: TextParser
# 需要导入模块: from exactly_lib.util.textformat.textformat_parser import TextParser [as 别名]
# 或者: from exactly_lib.util.textformat.textformat_parser.TextParser import section_contents [as 别名]
Used for arbitrary string values, and relative file names.
When used as a relative file name, {POSIX_SYNTAX} should be used.
"""
_TEXT_PARSER = TextParser({
'run': InstructionName(instruction_names.RUN_INSTRUCTION_NAME),
'POSIX_SYNTAX': POSIX_SYNTAX,
'ATC': formatting.concept_(concepts.ACTION_TO_CHECK_CONCEPT_INFO),
})
STRING_DOCUMENTATION = TypeDocumentation(TypeCategory.DATA,
types.STRING_TYPE_INFO,
syntax_elements.STRING_SYNTAX_ELEMENT,
_TEXT_PARSER.section_contents(_STRING_MAIN_DESCRIPTION_REST)
)
LIST_DOCUMENTATION = TypeDocumentation(TypeCategory.DATA,
types.LIST_TYPE_INFO,
syntax_elements.LIST_SYNTAX_ELEMENT,
_TEXT_PARSER.section_contents(_LIST_MAIN_DESCRIPTION_REST)
)
PATH_DOCUMENTATION = TypeDocumentation(TypeCategory.DATA,
types.PATH_TYPE_INFO,
syntax_elements.PATH_SYNTAX_ELEMENT,
SectionContents([],
[
path_type_path_rendering()
]),