Example #1
0
    def test_invalid_source_path(self, tmp_path, source_dir):
        source_dir = Path(source_dir).expanduser()
        source_path = (tmp_path / source_dir).resolve()
        source_path.mkdir(parents=True, exist_ok=True)

        pattern = re.escape(
            f"Source path '{source_path}' has to be relative to your project root "
            f"'{tmp_path.resolve()}'")
        with raises(ValueError, match=pattern):
            _validate_source_path(source_path, tmp_path.resolve())
Example #2
0
    def test_non_existent_source_path(self, tmp_path):
        source_path = (tmp_path / "non_existent").resolve()

        pattern = re.escape(f"Source path '{source_path}' cannot be found.")
        with raises(NotADirectoryError, match=pattern):
            _validate_source_path(source_path, tmp_path.resolve())
Example #3
0
 def test_valid_source_path(self, tmp_path, source_dir):
     source_path = (tmp_path / source_dir).resolve()
     source_path.mkdir(parents=True, exist_ok=True)
     _validate_source_path(source_path, tmp_path.resolve())