Skip to content

Commit e764720

Browse files
committed
testsuite: add Python job_list* constraint tests
Problem: None of the Python tests ensure the job_list and job_list_inactive optional constraint parameters work. Add a couple simple tests to t0013-job-list.py that ensure the constraint parameters to these functions do something.
1 parent fc83f32 commit e764720

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

t/python/t0013-job-list.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,18 @@ def test_18_list_id_fail(self):
320320
with self.assertRaises(FileNotFoundError):
321321
rpc_handle.get_jobinfo()
322322

323+
def test_19_list_inactive_constraints(self):
324+
for job in flux.job.job_list_inactive(
325+
self.fh, constraint={"name": ["sleep"]}
326+
).get_jobinfos():
327+
self.assertEqual(job.name, "sleep")
328+
329+
def test_20_list_constraints(self):
330+
for job in flux.job.job_list(
331+
self.fh, constraint={"name": ["sleep"]}
332+
).get_jobinfos():
333+
self.assertEqual(job.name, "sleep")
334+
323335

324336
if __name__ == "__main__":
325337
from subflux import rerun_under_flux

0 commit comments

Comments
 (0)