-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #679 from opensafely-core/fix-add-job
Fix add_job cli command
- Loading branch information
Showing
4 changed files
with
27 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
from jobrunner.cli import add_job | ||
from jobrunner.lib import database | ||
from jobrunner.models import Job | ||
|
||
|
||
def test_add_job(tmp_work_dir, db, test_repo): | ||
job_request, jobs = add_job.run([str(test_repo.path), "generate_dataset"]) | ||
|
||
assert len(jobs) == 1 | ||
assert jobs[0].action == "generate_dataset" | ||
|
||
db_jobs = database.find_where(Job, job_request_id=job_request.id) | ||
assert len(db_jobs) == 1 | ||
assert db_jobs[0].action == "generate_dataset" |