Skip to content
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

Merged

Conversation

lp9052
Copy link
Contributor

@lp9052 lp9052 commented Jun 30, 2023

see #149

@lp9052
Copy link
Contributor Author

lp9052 commented Jun 30, 2023

in my own project I use use_reactive with call back instead of using subscribe and use_effect. Which I find might be a little more straightforward and easier to understand

@lp9052
Copy link
Contributor Author

lp9052 commented Jun 30, 2023

oopsie, what happened to all these actions :)

@lp9052
Copy link
Contributor Author

lp9052 commented Jun 30, 2023

Pydantic just updated to 2.0. Shall we limit the version to <2.0 for now?

Copy link
Contributor

@maartenbreddels maartenbreddels left a 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

Copy link
Contributor Author

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?

Copy link
Contributor

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!

@maartenbreddels maartenbreddels force-pushed the modify_file_browser_unit_test_lp9052 branch from 5182f0d to 9ff15ca Compare July 1, 2023 08:12
@maartenbreddels maartenbreddels merged commit 6b79bfc into widgetti:master Jul 7, 2023
@lp9052 lp9052 deleted the modify_file_browser_unit_test_lp9052 branch July 11, 2023 02:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants