示例#1
0
 def raw_files_to_sync(self) -> List[RawSyncFilesItem]:
     if not self._raw_files_to_sync:
         raw_files_to_sync: List[RawSyncFilesItem] = []
         for sync in self.files_to_sync:
             raw_files_to_sync += get_raw_files(file_to_sync=sync)
         self._raw_files_to_sync = raw_files_to_sync
     return self._raw_files_to_sync
示例#2
0
 def get_raw_files_to_sync(self, src_dir: Path,
                           dest_dir: Path) -> List[RawSyncFilesItem]:
     """
     Evaluate sync_files: render globs and prepend full paths
     """
     raw_files_to_sync: List[RawSyncFilesItem] = []
     for sync in self.files_to_sync:
         raw_files_to_sync += get_raw_files(src_dir, dest_dir, sync)
     return raw_files_to_sync
示例#3
0
def test_get_raw_files(file, glob_files, result):
    if glob_files is not None:
        flexmock(glob, glob=lambda x: glob_files)

    files = get_raw_files(file_to_sync=file)
    assert files == result
示例#4
0
def test_get_raw_files(file, glob_files, result):
    flexmock(Path, glob=lambda x: glob_files)

    files = get_raw_files(Path("."), Path("."), file)
    assert files == result