#271: Added method relative_to to interface PathLike#272
Conversation
| pass | ||
|
|
||
|
|
||
| def test_relative_not_bucket_path(bucket_fake): |
There was a problem hiding this comment.
what's the difference of this test compared to test_foreign_bucket?
There was a problem hiding this comment.
This test deliberately uses an instance of class NotBucketPath instead of bfs.path.BucketPath to verify the if statement in the implementation.
There was a problem hiding this comment.
Hm, but both test basically tes tthe if statement at line 347:
if self._bucket_api != other.bucket_api:
raise BucketFsError(
"BucketPath.relative_to() called with other"
f" from a foreign bucket {other._bucket_api}."
)
=> Also the expected error message is probably the same.
Or do I get something wrong...
There was a problem hiding this comment.
Many thanks for being persistent on this.
I finally found the problem and (hopefully) fixed it.
Please review again.
exasol/bucketfs/_path.py
Outdated
| def parent(self) -> PathLike: | ||
| return BucketPath(self._path.parent, self._bucket_api) | ||
|
|
||
| def relative_to(self, other_pathlike: PathLike) -> PurePath: |
There was a problem hiding this comment.
this needs a docstring, to explain what exactly the result is
There was a problem hiding this comment.
Please see the docstring in the public interface PathLike instead, which I additionally updated based on our discussion.
|



Closes #271
Submission Checklist
doc/changes/unreleased.mdIf required
If doing a release
poetry run -- nox -s release:prepare