-
Notifications
You must be signed in to change notification settings - Fork 0
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
Flexible working directory #31
base: develop
Are you sure you want to change the base?
Conversation
# change the working directory if it exists | ||
if os.path.exists(self.workflow_dict["working_dir"]): | ||
os.chdir(self.workflow_dict["working_dir"]) | ||
logging.info("Change current working path to the specified 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.
I have added this part to create a new directory if it doesn't exist
) | ||
|
||
def test_dir_simple(self): | ||
"""This test checks when a simple working directory without any "\\" or "/" is provided and it also points to the correct 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.
Added this unittest for paths without "\\"
or "/"
"INFO:root:Change current working path to the specified path.", | ||
) | ||
|
||
def test_dir_not_exist(self): |
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.
Add this test for path that doesn't exist
"INFO:root:Change current working path to the specified path.", | ||
) | ||
|
||
def test_valid_absolute_dir(self): |
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.
Add this test for absolute path
Hi @Fan-Feng , could you please let me know when do you expect this PR to be ready for another review? |
Hi, Jerry, I am swamped with the residential analysis tasks these weeks, and I can make some progress next week. |
|
||
self.assertEqual( | ||
logobs.output[1], | ||
"INFO:root:working directory specified does not exist and create a new director.", | ||
) | ||
|
||
def test_dir_without_seperator(self): |
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.
I have added a unit test for working directories without any "/" or "\"
This PR adds the functionality of being able to specify the working directory of the current workflow, to allow users to run workflow anywhere on either a Linux or Windows system.