-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement: modify file bowser unit test to make it easier to understand #188
enhancement: modify file bowser unit test to make it easier to understand #188
Conversation
in my own project I use |
oopsie, what happened to all these actions :) |
Pydantic just updated to 2.0. Shall we limit the version to <2.0 for now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
if not str(value).startswith(str(BASE_PATH)): | ||
directory.value = BASE_PATH | ||
def set_directory(path: Path) -> None: | ||
directory.value = path if str(path).startswith(str(BASE_PATH)) else BASE_PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
directory.value = path if str(path).startswith(str(BASE_PATH)) else BASE_PATH | |
directory.value = path if str(path).startswith(str(BASE_PATH)) else BASE_PATH |
Just to make you aware that this will always assign and will always need to do a comparison. Not that it matters because it is a test, but this might be slower in cases where compare is slow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I never thought about that. But it would also hard to imagine a path comparison could be too expensive. Do you have an example in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, just wanted to make you aware that the behaviour has changed. Happy to merge this as is!
5182f0d
to
9ff15ca
Compare
see #149