Implement a flag that allows simulteanous job launches on job templates

This commit is contained in:
Matthew Jones
2016-06-02 14:58:05 -04:00
parent a6e06588b4
commit 0591647333
4 changed files with 39 additions and 1 deletions
+13
View File
@@ -22,3 +22,16 @@ def test_job_blocking(get, post, job_template, inventory, inventory_factory):
assert j_callback_1.is_blocked_by(j_callback_2)
j_callback_2.limit = 'b'
assert not j_callback_1.is_blocked_by(j_callback_2)
@pytest.mark.django_db
def test_job_blocking_allow_simul(get, post, job_template, inventory):
job_template.allow_simultaneous = True
j1 = Job.objects.create(job_template=job_template,
inventory=inventory)
j2 = Job.objects.create(job_template=job_template,
inventory=inventory)
assert not j1.is_blocked_by(j2)
assert not j2.is_blocked_by(j1)
job_template.allow_simultaneous = False
assert j1.is_blocked_by(j2)
assert j2.is_blocked_by(j1)