-
Notifications
You must be signed in to change notification settings - Fork 337
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 list with whitespace #588
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -226,6 +226,19 @@ def _data(self): | |
finally: | ||
os.environ = old_environ | ||
|
||
def test_7(self): | ||
"""Test path list environment variable with whitespace.""" | ||
c = Config([self.root_config_file], locked=False) | ||
|
||
# test basic env-var override | ||
packages_path = [ | ||
"c:/foo bar/baz", | ||
"c:/foo 2 bar/baz", | ||
] | ||
asztalosdani marked this conversation as resolved.
Show resolved
Hide resolved
|
||
os.environ["REZ_PACKAGES_PATH"] = os.pathsep.join(packages_path) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it is not a good idea to change an environment variable in the UT as it affects all other tests that are run as part of the same process (i.e when running rez selftests)
or if you are going to use it several times create a Also, I do not understand the original use case of this change. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed on not changing variables that persist across tests, however:
The folder There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would quotes work in this case? ie. "c:\foo bar"? |
||
|
||
self.assertEqual(c.packages_path, packages_path) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
|
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.
fails on linux (pathsep is
:
)