Skip to content
Snippets Groups Projects

Request all host groups from AWX if summary is not enough

Merged Anders Harrisson requested to merge INFRA-10887 into main
1 file
+ 5
5
Compare changes
  • Side-by-side
  • Inline
@@ -84,7 +84,7 @@ class SynchronizationTestCase(TestCase):
{
'id': 1,
'name': 'test-device.example.com',
'summary_fields': {'groups': {'results': []}}
'summary_fields': {'groups': {'count': 0, 'results': []}}
} # Second call returns a mock host
]
# Simulate that the group exists
@@ -105,7 +105,7 @@ class SynchronizationTestCase(TestCase):
mock_get_host.return_value = {
'id': 1,
'name': 'test-device.example.com',
'summary_fields': {'groups': {'results': []}}
'summary_fields': {'groups': {'count': 0, 'results': []}}
}
# Simulate that the group exists
mock_get_group.return_value = {'id': 2, 'name': 'site_test_site'}
@@ -162,7 +162,7 @@ class SynchronizationTestCase(TestCase):
mock_get_host.return_value = {
'id': 1,
'name': 'test-device.example.com',
'summary_fields': {'groups': {'results': []}}
'summary_fields': {'groups': {'count': 0, 'results': []}}
}
sync_host(self.awx_inventory, Device, self.device)
# Check that the host is associated with the tag group
@@ -223,7 +223,7 @@ class SynchronizationTestCase(TestCase):
{
'id': 1,
'name': 'test-vm.example.com',
'summary_fields': {'groups': {'results': []}}
'summary_fields': {'groups': {'count': 0, 'results': []}}
} # Second call returns a mock host
]
# Simulate that the group exists for the VM role
@@ -248,7 +248,7 @@ class SynchronizationTestCase(TestCase):
mock_get_host.return_value = {
'id': 1,
'name': self.device.name,
'summary_fields': {'groups': {'results': []}}
'summary_fields': {'groups': {'count': 0, 'results': []}}
}
# Mock get_group to prevent network calls
mock_get_group.return_value = {'id': 2, 'name': 'site_test_site'}
Loading