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

When creating job, create folder if not existed. #48

Merged
merged 5 commits into from
Apr 8, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions api4jenkins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ def create_job(self, full_name, xml):
<FreeStyleProject: http://127.0.0.1:8080/job/freestylejob/>
'''
folder, name = self._resolve_name(full_name)
if not folder.exists():
Copy link
Owner

Choose a reason for hiding this comment

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

how about add parameter recursive with default value False to let user make choice ?
and please add test case as well, thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added. thanks.
I only added in test_create_job_succ. Maybe some test cases are also needed in test_create_job_fail. 🤔

Copy link
Owner

Choose a reason for hiding this comment

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

it's pretty good.

self.create_job(folder.full_name, EMPTY_FOLDER_XML)
return folder.create(name, xml)

def copy_job(self, full_name, dest):
Expand Down