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

Fix path dependency in convert_to_path test #749

Merged
merged 6 commits into from
Dec 1, 2023

Conversation

RHammond2
Copy link
Collaborator

Fix Minor Test Issue in convert_to_path

This PR addresses an error that's raised in type_dec_unit_test.py:test_convert_to_path when run from within the "tests" folder, as opposed to from the "floris" directory. As a result of #739, convert_to_path attempts to validate three separate path relationships to return a path that exists, or fails, so the updated unit test now reflects that usage, and checks for a FileExistsError in floris/tests/tests/ regardless of where pytest is invoked.

Related issue

N/A

Impacted areas of the software

  • type_dec_unit_test.py:test_convert_to_path: Updated the third subtest to reflect the updated logic of convert_to_path

Additional supporting information

N/A

Test results, if applicable

All tests pass, regardless of where pytest is run from.

@RHammond2 RHammond2 added the bug Something isn't working label Nov 30, 2023
@rafmudaf rafmudaf changed the title Fix Minor Test Issue in convert_to_path Fix minor test issue in convert_to_path Nov 30, 2023
@rafmudaf rafmudaf added this to the v3.6 milestone Dec 1, 2023
@rafmudaf rafmudaf self-assigned this Dec 1, 2023
@rafmudaf rafmudaf changed the title Fix minor test issue in convert_to_path Fix path dependency in convert_to_path test Dec 1, 2023
@rafmudaf
Copy link
Collaborator

rafmudaf commented Dec 1, 2023

@RHammond2 I expanded the test here a little and noticed that the convert_to_path function doesn't find files since the if-statements use is_dir(). If you change that to exists(), then it will support searching for both directories and files.

@RHammond2
Copy link
Collaborator Author

Thanks for the update, @rafmudaf, I think that makes a lot of sense. I intended to have the method to find paths, but I don't see any issue with expanding it to files too. I assume that'd actually make it a bit more useful as a utility function. I'll make that change on my end and double check on the tests.

@rafmudaf rafmudaf merged commit 599f226 into NREL:develop Dec 1, 2023
8 checks passed
@RHammond2 RHammond2 deleted the bug_fix/type_dec_test branch December 1, 2023 18:42
@misi9170 misi9170 mentioned this pull request Apr 5, 2024
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants