示例#1
0
 def __init__(self, src_dir: PathDdv):
     self._src_dir = src_dir
     self._validator = path_check.PathCheckDdvValidator(
         path_check.PathCheckDdv(
             src_dir,
             file_properties.must_exist_as(
                 file_properties.FileType.DIRECTORY, follow_symlinks=True)))
示例#2
0
 def __init__(
     self,
     names: NamesSetup,
     model_constructor: ModelConstructor[CONTENTS_MATCHER_MODEL],
     contents_matcher: MatcherWTrace[CONTENTS_MATCHER_MODEL],
 ):
     super().__init__()
     self._names = names
     self._model_constructor = model_constructor
     self._expected_file_check = file_properties.must_exist_as(
         names.accepted_file_type, follow_symlinks=True)
     self._contents_matcher = contents_matcher
示例#3
0
    def check(self, environment: InstructionEnvironmentForPostSdsStep,
              os_services: OsServices,
              files_source: FilesSource) -> FilesSource:
        expect_existing_dir = file_properties.must_exist_as(
            file_properties.FileType.DIRECTORY, True)

        path_resolving_env = environment.path_resolving_environment_pre_or_post_sds
        failure_message = path_check.pre_or_post_sds_failure_message_or_none(
            path_check.PathCheck(files_source.path_of_dir,
                                 expect_existing_dir), path_resolving_env)
        if failure_message is not None:
            raise pfh_ex_method.PfhHardErrorException(failure_message)
        else:
            return files_source
示例#4
0
    def __init__(
        self,
        symbol_usages: Sequence[SymbolUsage],
        interpreter_and_args_validator: SdvValidator,
        source_file: PathSdv,
        make_command: Callable[[FullResolvingEnvironment], Command],
    ):
        self._symbol_usages = symbol_usages
        self._source_file = source_file
        self._make_command = make_command

        self._validator = sdv_validation.all_of([
            interpreter_and_args_validator,
            PathCheckValidator(
                PathCheck(
                    source_file,
                    file_properties.must_exist_as(
                        file_properties.FileType.REGULAR))),
        ])
示例#5
0
 def _the_property_check() -> sut.FilePropertiesCheck:
     return sut.must_exist_as(FileType.SYMLINK, False)
示例#6
0
 def _the_property_check() -> sut.FilePropertiesCheck:
     return sut.must_exist_as(FileType.DIRECTORY, False)
示例#7
0
 def _the_property_check(self) -> sut.FilePropertiesCheck:
     return sut.must_exist_as(FileType.REGULAR)
示例#8
0
 def __init__(self):
     super().__init__()
     self._is_regular_file_check = file_properties.must_exist_as(
         file_properties.FileType.REGULAR, follow_symlinks=True)
示例#9
0
 def __init__(self,
              file_type: FileType,
              maker: Callable[[DescribedPath], None],
              ):
     self._file_check = file_properties.must_exist_as(file_type, follow_symlinks=True)
     self._maker = maker
示例#10
0
 def __init__(self, path: PathDdv):
     self._path = path
     self._validator = path_check.PathCheckDdvValidator(
         path_check.PathCheckDdv(
             path, file_properties.must_exist_as(FileType.REGULAR)))
示例#11
0
 def get_file_validator(symbols: SymbolTable) -> DdvValidator:
     return PathCheckDdvValidator(
         PathCheckDdv(file_that_must_exist.resolve(symbols),
                      file_properties.must_exist_as(file_type)))