|
|
@ -238,3 +238,11 @@ class TestInventory(unittest.TestCase):
|
|
|
|
'group_names': ['norse'],
|
|
|
|
'group_names': ['norse'],
|
|
|
|
'inventory_hostname': 'thor',
|
|
|
|
'inventory_hostname': 'thor',
|
|
|
|
'inventory_hostname_short': 'thor'}
|
|
|
|
'inventory_hostname_short': 'thor'}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_hosts_list(self):
|
|
|
|
|
|
|
|
"""Test the case when playbook 'hosts' var is a list."""
|
|
|
|
|
|
|
|
inventory = self.script_inventory()
|
|
|
|
|
|
|
|
host_names = sorted(['thor', 'loki', 'odin']) # Not sure if sorting is in the contract or not
|
|
|
|
|
|
|
|
actual_hosts = inventory.get_hosts(host_names)
|
|
|
|
|
|
|
|
actual_host_names = [host.name for host in actual_hosts]
|
|
|
|
|
|
|
|
assert host_names == actual_host_names
|
|
|
|