コード例 #1
0
 def test_visit_EntityCrossReferenceId(self):
     # ARRANGE #
     x = sut.EntityCrossReferenceId(
         EntityTypeNames('entity_type_identifier',
                         name_with_plural_s('presentation name')),
         'entity name')
     visitor = VisitorThatRegistersVisitedClassesAndReturnsTheArgument()
     # ACT #
     returned = visitor.visit(x)
     # ASSERT #
     self.assertEqual([sut.EntityCrossReferenceId], visitor.visited_classes)
     self.assertIs(
         x, returned,
         'The object itself is expected to be returned by the visitor')
コード例 #2
0
ファイル: defs.py プロジェクト: emilkarlen/exactly
from exactly_lib.util.str_ import name

DESCRIPTION_DELIMITER = '`'

DESCRIPTION_DELIMITER_CHAR_NAME = name.NameWithGenderWithFormatting(
    name.a_name(name.name_with_plural_s('backtick')))
END_OF_FILE = 'END-OF-FILE'
END_OF_LINE = 'END-OF-LINE'

INSTRUCTION = name.NameWithGenderWithFormatting(
    name.an_name(name.name_with_plural_s('instruction')))

INSTRUCTION_DESCRIPTION = name.NameWithGenderWithFormatting(
    name.an_name(name.name_with_plural_s('instruction description')))


def format_constant(constant: str) -> str:
    return '"' + constant + '"'
コード例 #3
0
def entity_type_names(identifier: str,
                      presentation_name: str) -> EntityTypeNames:
    return EntityTypeNames(identifier, name_with_plural_s(presentation_name))
コード例 #4
0
ファイル: processing.py プロジェクト: emilkarlen/exactly
from exactly_lib.definitions.formatting import misc_name_with_formatting
from exactly_lib.util.str_ import name

STEP_PRE_PROCESSING = misc_name_with_formatting(
    name.a_name(name.name_with_plural_s('preprocessing')))

STEP_VALIDATION = misc_name_with_formatting(
    name.a_name(name.name_with_plural_s('validation')))

STEP_EXECUTION = misc_name_with_formatting(
    name.an_name(name.name_with_plural_s('execution')))
コード例 #5
0
ファイル: misc_texts.py プロジェクト: emilkarlen/exactly
from exactly_lib.definitions import formatting
from exactly_lib.definitions.entity import all_entity_types
from exactly_lib.definitions.formatting import misc_name_with_formatting
from exactly_lib.util.str_ import name

WHITESPACE = 'whitespace'

RESERVED_WORD_NAME = name.a_name(name.name_with_plural_s('reserved word'))

SYNTAX_ERROR_NAME = name.a_name(name.name_with_plural_s('syntax error'))

FILE_ACCESS_ERROR_NAME = name.a_name(
    name.name_with_plural_s('file access error'))

EXIT_IDENTIFIER = misc_name_with_formatting(
    name.an_name(name.name_with_plural_s('exit identifier')))

EXIT_CODE = misc_name_with_formatting(
    name.an_name(name.name_with_plural_s('exit code')))
EXIT_CODE_TITLE = EXIT_CODE.singular.capitalize()

STDOUT = 'stdout'
STDERR = 'stderr'
STDIN = 'stdin'

OS_PROCESS_NAME = misc_name_with_formatting(
    name.an_name(name.Name('OS process', 'OS processes')))

CURRENT_OS = 'current OS'

NEW_LINE_STRING_CONSTANT = formatting.string_constant('\\n')
コード例 #6
0
    def _assert_at_least_one_line_was_generated(self, actual_lines):
        if not actual_lines:
            self.fail('No lines at all was generated')

    def _assert_line_is_number_of_executed_tests_line(self, line: str,
                                                      num_cases: int):
        reg_ex = '^Ran %d tests in .*' % num_cases
        self.assertRegex(line, reg_ex,
                         'Line that reports number of tests and elapsed time')


def _number_of_unsuccessful_tests_line(num_cases: int) -> str:
    return _NUMBER_OF_ERRORS.of(num_cases)


_NUMBER_OF_ERRORS = name.NumberOfItemsString(name.name_with_plural_s('error'))


def _suite_executor_for_case_processing_that_unconditionally(
        execution_result: FullExeResult,
        root_suite: structure.TestSuiteHierarchy,
        std_output_files: StringStdOutFiles,
        root_file_path: Path) -> SuitesExecutor:
    factory = sut.SimpleProgressRootSuiteProcessingReporter()
    execution_reporter = factory.execution_reporter(
        root_suite, std_output_files.reporting_environment, root_file_path)
    case_result = test_case_processing.new_executed(execution_result)
    return processing.SuitesExecutor(
        execution_reporter, DUMMY_CASE_PROCESSING,
        lambda conf: TestCaseProcessorThatGivesConstant(case_result))