fix FilePath and DirectoryPath
@@ -329,6 +329,7 @@ class FilePath(Path):
yield path_exists_validator
yield cls.validate
+ @classmethod
def validate(cls, value: Path) -> Path:
if not value.is_file():
raise errors.PathNotAFileError(path=value)
@@ -343,6 +344,7 @@ class DirectoryPath(Path):
yield path_exists_validator
yield cls.validate
+ @classmethod
def validate(cls, value: Path) -> Path:
if not value.is_dir():
raise errors.PathNotADirectoryError(path=value)
