mirror of
https://github.com/ansible/awx.git
synced 2026-09-04 19:08:30 -02:30
added 'ignored' and 'rescued' into all_hosts dictionary update
This commit is contained in:
@@ -2,7 +2,7 @@ import pytest
|
||||
from unittest import mock
|
||||
import json
|
||||
|
||||
from awx.main.models import Job, Instance
|
||||
from awx.main.models import Job, Instance, JobHostSummary
|
||||
from awx.main.tasks import cluster_node_heartbeat
|
||||
from django.test.utils import override_settings
|
||||
|
||||
@@ -47,6 +47,24 @@ def test_job_notification_data(inventory, machine_credential, project):
|
||||
assert json.loads(notification_data['extra_vars'])['SSN'] == encrypted_str
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
def test_job_notification_host_data(inventory, machine_credential, project, job_template, host):
|
||||
job = Job.objects.create(
|
||||
job_template=job_template, inventory=inventory, name='hi world', project=project
|
||||
)
|
||||
JobHostSummary.objects.create(job=job, host=host, changed=1, dark=2, failures=3, ok=4, processed=3, skipped=2, rescued=1, ignored=0)
|
||||
assert job.notification_data()['hosts'] == {'single-host':
|
||||
{'failed': True,
|
||||
'changed': 1,
|
||||
'dark': 2,
|
||||
'failures': 3,
|
||||
'ok': 4,
|
||||
'processed': 3,
|
||||
'skipped': 2,
|
||||
'rescued': 1,
|
||||
'ignored': 0}}
|
||||
|
||||
|
||||
@pytest.mark.django_db
|
||||
class TestLaunchConfig:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user