mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Return multiple groups from inventory API.
This commit is contained in:
@@ -246,3 +246,13 @@ class TestInventory(unittest.TestCase):
|
||||
actual_hosts = inventory.get_hosts(host_names)
|
||||
actual_host_names = [host.name for host in actual_hosts]
|
||||
assert host_names == actual_host_names
|
||||
|
||||
def test_script_multiple_groups(self):
|
||||
inventory = self.script_inventory()
|
||||
vars = inventory.get_variables('zeus')
|
||||
|
||||
print "VARS=%s" % vars
|
||||
|
||||
assert vars == {'inventory_hostname': 'zeus',
|
||||
'inventory_hostname_short': 'zeus',
|
||||
'group_names': ['greek', 'major-god']}
|
||||
|
||||
Reference in New Issue
Block a user