Add Commands for Remaining Scrapyd API Endpoints#133
Closed
ivangoranov wants to merge 7 commits intoscrapy:masterfrom
Closed
Add Commands for Remaining Scrapyd API Endpoints#133ivangoranov wants to merge 7 commits intoscrapy:masterfrom
ivangoranov wants to merge 7 commits intoscrapy:masterfrom
Conversation
6 tasks
…s; Remove "all" functionality; Simplify docstrings.
Contributor
|
Thank you for this! I removed the error handling for non-existent projects/versions/jobs, as the API already returns an error response if the project/version/job doesn't exist, and it is an unnecessary API request if the user knows the project/version/job exists. I also think users should be able to implement the "all" functionality of for version in client.versions(project):
client.delversion(project, version)responses = {jobid: client.cancel(project, jobid) for jobid in client.jobs(project)["running"]} |
Contributor
|
I rebased this branch into the default branch from the command line. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related: #98
This pull request adds new functionalities to the
ScrapydClientclass and introduces comprehensive test coverage for these features. The changes include new methods for managing Scrapyd projects, versions, and jobs, as well as corresponding unit tests to ensure their correctness.New Features in
ScrapydClient:Daemon Status and Versions Management:
daemonstatusmethod to fetch the status of the Scrapyd daemon.versionsmethod to list versions of a given project.Project and Version Deletion:
delprojectmethod to delete a project, with error handling for non-existent projects.delversionmethod to delete specific or all versions of a project, with error handling for invalid versions.Job Management:
cancelmethod to cancel a specific job or all running jobs within a project, with validation for project and job existence.Test Coverage:
Tests for Daemon Status and Versions:
daemonstatusto validate successful and error responses.versionsto handle scenarios with valid versions, no versions, and error responses.Tests for Project and Version Deletion:
delprojectto ensure proper handling of non-existent projects and successful deletion.delversionto validate deletion of specific or all versions and error handling for invalid inputs.Tests for Job Management:
cancelto verify cancellation of specific jobs, all jobs, and error handling for invalid projects or jobs.