-
Notifications
You must be signed in to change notification settings - Fork 31
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 #255 from bessagroup/mpvanderschelling/issue250
Mpvanderschelling/issue250
- Loading branch information
Showing
4 changed files
with
107 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import pandas as pd | ||
|
||
from f3dasm._src.experimentdata._jobqueue import _JobQueue | ||
|
||
|
||
def test_select_all_with_matching_status(): | ||
# Create a job queue with some jobs | ||
job_queue = _JobQueue() | ||
job_queue.jobs = pd.Series(['in progress', 'running', 'completed', 'in progress', 'failed']) | ||
|
||
# Select all jobs with status 'in progress' | ||
selected_jobs = job_queue.select_all('in progress') | ||
|
||
# Check if the selected jobs match the expected result | ||
assert (selected_jobs.jobs == ['in progress', 'in progress']).all() | ||
|
||
def test_select_all_with_no_matching_status(): | ||
# Create a job queue with some jobs | ||
job_queue = _JobQueue() | ||
job_queue.jobs = pd.Series(['in progress', 'running', 'completed', 'in progress', 'failed']) | ||
|
||
# Select all jobs with status 'cancelled' | ||
selected_jobs = job_queue.select_all('cancelled') | ||
|
||
# Check if the selected jobs match the expected result | ||
assert selected_jobs.jobs.empty | ||
|
||
def test_select_all_with_empty_job_queue(): | ||
# Create an empty job queue | ||
job_queue = _JobQueue() | ||
|
||
# Select all jobs with status 'in progress' | ||
selected_jobs = job_queue.select_all('in progress') | ||
|
||
# Check if the selected jobs match the expected result | ||
assert selected_jobs.jobs.empty |
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