Example #1
0
 def __init__(
     self,
     name: str,
     tcds: TestCaseDs,
 ):
     self._name = name
     self._name_and_value_list = _derive_name_and_value_list(tcds)
     self._structure = renderers.header_only(name)
def sequence_of_unknown_num_operands(
        operands: Sequence[WithNodeDescription]) -> StructureRenderer:
    num_operands = len(operands)

    if num_operands == 0:
        return renderers.header_only(
            string_transformer.IDENTITY_TRANSFORMER_NAME)
    elif num_operands == 1:
        return operands[0].structure()
    else:
        return sequence_of_at_least_2_operands(operands)
Example #3
0
 def structure(self) -> StructureRenderer:
     return renderers.header_only(self._name)
Example #4
0
 def _structure(self) -> StructureRenderer:
     return renderers.header_only(_NAME)
Example #5
0
def _get_transformer_structure() -> StructureRenderer:
    return renderers.header_only('the-transformer')
Example #6
0
 def structure(self) -> StructureRenderer:
     return renderers.header_only('unused')
Example #7
0
 def _structure(self) -> StructureRenderer:
     return renderers.header_only(file_matcher.WHOLE_PATH_MATCHER_NAME)
Example #8
0
def structure_renderer_for_arbitrary_object(x) -> StructureRenderer:
    return renderers.header_only(str(type(x)))
Example #9
0
 def _structure(self) -> StructureRenderer:
     return renderers.header_only('contents')
Example #10
0
def _transformer_description() -> StructureRenderer:
    return renderers.header_only('the header')
Example #11
0
 def new_structure_tree() -> StructureRenderer:
     return renderers.header_only(EmptinessStringMatcher.NAME)
Example #12
0
from exactly_lib.definitions import logic
from exactly_lib.test_case.hard_error import HardErrorException
from exactly_lib.type_val_prims.description.tree_structured import StructureRenderer
from exactly_lib.type_val_prims.matcher.matcher_base_class import MatcherWTrace, MatcherStdTypeVisitor
from exactly_lib.type_val_prims.matcher.matching_result import MatchingResult
from exactly_lib.util.description_tree import renderers, tree
from exactly_lib_test.common.test_resources.text_doc_assertions import new_single_string_text_for_test
from exactly_lib_test.util.render.test_resources import renderers as renderers_tr

MODEL = TypeVar('MODEL')
ACTUAL = TypeVar('ACTUAL')

T = TypeVar('T')

STRUCTURE_FOR_TEST = renderers.header_only('test-resource-structure')


class MatcherTestImplBase(Generic[MODEL],
                          MatcherWTrace[MODEL],
                          ABC):

    @property
    def name(self) -> str:
        return str(type(self))

    def structure(self) -> StructureRenderer:
        return renderers_tr.structure_renderer_for_arbitrary_object(self)


class ConstantMatcherTestImplBase(Generic[MODEL], MatcherWTrace[MODEL], ABC):