1from abc
import ABC, abstractmethod
2from collections.abc
import Iterator
3from pathlib
import Path
4from typing
import Callable, TypeVar
13 return Path(typed_path.absolute_path).is_file()
16 self, typed_path: TypedPath, walk: Callable[[Iterator[TypedPath]], T]
18 def walk_generator(path: TypedPath) -> Iterator[TypedPath]:
19 for file_path
in Path(path.absolute_path).rglob(
"*"):
20 if file_path.is_file():
21 yield TypedPath(file_path.absolute().as_posix())
23 return walk(walk_generator(typed_path))
32 return Path(typed_path.absolute_path).read_bytes()
35 Path(typed_path.absolute_path).write_bytes(content)
38 def assert_failed(self, message, expected=None, actual=None) -> Exception:
bool file_exists(self, TypedPath typed_path)
file_write(self, typed_path, str content)
T file_walk(self, TypedPath typed_path, Callable[[Iterator[TypedPath]], T] walk)
str file_read(self, typed_path)
Exception assert_failed(self, message, expected=None, actual=None)
bytes file_read_binary(self, TypedPath typed_path)
file_write_binary(self, TypedPath typed_path, bytes content)