def runTest(self): # ARRANGE # files_matcher_name = 'the_files_matcher' checked_dir_location = RelSdsOptionType.REL_TMP checked_dir = Dir.empty('checked-dir') # ACT & ASSERT # integration_check.CHECKER__PARSE_FULL.check_multi__w_source_variants( self, arguments=fm_args.DirContentsRecursive( fsm_args.SymbolReference(files_matcher_name)).as_arguments, input_=integration_check.file_in_sds(checked_dir_location, checked_dir.name), symbol_references=asrt.matches_singleton_sequence( is_reference_to_files_matcher(files_matcher_name)), execution=[ NExArr( 'checked dir is empty', PrimAndExeExpectation.of_exe( main_result=asrt_matching_result.matches_value( matcher_result)), arrangement_w_tcds( non_hds_contents=sds_populator.contents_in( checked_dir_location, DirContents([checked_dir])), symbols=FilesMatcherSymbolContext. of_primitive_constant(files_matcher_name, matcher_result).symbol_table), ) for matcher_result in [False, True] ], )
def runTest(self): # ARRANGE # files_matcher = FilesMatcherSymbolContextOfPrimitiveConstant( 'MATCHER', True, ) after_bin_op = 'after bin op' # ACT & ASSERT # integration_check.CHECKER__PARSE_SIMPLE.check( self, source=args.DirContentsRecursive( fsm_args.conjunction([ fsm_args.SymbolReference(files_matcher.name), fsm_args.Custom(after_bin_op), ]), ).as_remaining_source, input_=integration_check.current_directory(), arrangement=arrangement_w_tcds( symbols=files_matcher.symbol_table, ), expectation=Expectation( ParseExpectation( source=asrt_source.is_at_line( current_line_number=1, remaining_part_of_current_line=logic.AND_OPERATOR_NAME + ' ' + after_bin_op), symbol_references=files_matcher.references_assertion), ExecutionExpectation( main_result=asrt_matching_result.matches_value( files_matcher.result_value))), )
def runTest(self): unconditionally_constant_true = FilesMatcherSymbolContext.of_primitive_constant( 'unconditionally_constant_true', True) symbols = unconditionally_constant_true.symbol_table location = RelSdsOptionType.REL_TMP model_file_name = 'the-checked-file' integration_check.CHECKER__PARSE_FULL.check_multi__w_source_variants( self, arguments=args.DirContentsRecursive( args.SymbolReference( unconditionally_constant_true.name)).as_arguments, symbol_references=unconditionally_constant_true. references_assertion, input_=integration_check.file_in_sds(location, model_file_name), execution=[ NExArr( invalid_file_case.name, PrimAndExeExpectation.of_exe( is_hard_error=asrt_renderer. is_renderer_of_major_blocks()), arrangement_w_tcds( symbols=symbols, non_hds_contents=sds_populator.contents_in( location, invalid_file_case.value))) for invalid_file_case in invalid_model.cases(model_file_name) ])
def runTest(self): helper = HardErrorDueToHardErrorFromFilesMatcherHelper() integration_check.CHECKER__PARSE_FULL.check( self, source=fm_args.DirContentsRecursive( fsm_args.SymbolReference( helper.files_matcher_name)).as_remaining_source, input_=helper.model_constructor(), arrangement=helper.arrangement(), expectation=helper.expectation())
def runTest(self): fsm_symbol_name = 'the_files_matcher' integration_check.CHECKER__PARSE_FULL.check_multi__w_source_variants( self, args.DirContentsRecursive( args.SymbolReference(fsm_symbol_name)).as_arguments, symbol_references=asrt.matches_singleton_sequence( is_reference_to_files_matcher(fsm_symbol_name)), input_=integration_check.constant_relative_file_name( 'arbitrary-file-argument'), execution=instruction_validation_cases. failing_validation_cases__multi_exe(fsm_symbol_name))
class TestFilesOfModel(unittest.TestCase): def runTest(self): # ARRANGE # helper = IntegrationCheckHelper() contents_cases = test_data.strip_file_type_info_s([ test_data.identical_expected_and_actual(case.name, case.value) for case in test_data.cases() ]) # ACT & ASSERT # integration_check.CHECKER__PARSE_FULL.check_multi( self, arguments=fm_args.DirContentsRecursive( helper.files_matcher_sym_ref_arg()).as_arguments, parse_expectation=helper.parse_expectation_of_symbol_references(), input_=helper.model_constructor_for_checked_dir(), execution=[ NExArr( contents_case.name, PrimAndExeExpectation.of_exe(), helper.arrangement_for_contents_of_model( checked_dir_contents=contents_case.actual, files_matcher_symbol_value=model_checker.matcher( self, helper.dir_arg.path_sdv, contents_case.expected, ), ), ) for contents_case in contents_cases
def arg__recursive(self) -> FileMatcherArg: return fm_args.DirContentsRecursive( fms_args.Selection(fm_args.Type(FileType.REGULAR), self.setup.num_files_arg()))
def arg__recursive(self) -> FileMatcherArg: return fm_args.DirContentsRecursive(self.setup.num_files_arg())