|
|
@ -51,6 +51,13 @@ class TestInventory(unittest.TestCase):
|
|
|
|
expected_hosts=['thor', 'odin', 'loki']
|
|
|
|
expected_hosts=['thor', 'odin', 'loki']
|
|
|
|
assert hosts == expected_hosts
|
|
|
|
assert hosts == expected_hosts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_simple_ungrouped(self):
|
|
|
|
|
|
|
|
inventory = self.simple_inventory()
|
|
|
|
|
|
|
|
hosts = inventory.list_hosts("ungrouped")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expected_hosts=['jupiter', 'saturn']
|
|
|
|
|
|
|
|
assert hosts == expected_hosts
|
|
|
|
|
|
|
|
|
|
|
|
def test_simple_combined(self):
|
|
|
|
def test_simple_combined(self):
|
|
|
|
inventory = self.simple_inventory()
|
|
|
|
inventory = self.simple_inventory()
|
|
|
|
hosts = inventory.list_hosts("norse:greek")
|
|
|
|
hosts = inventory.list_hosts("norse:greek")
|
|
|
@ -176,6 +183,13 @@ class TestInventory(unittest.TestCase):
|
|
|
|
expected_hosts=['thor', 'odin', 'loki']
|
|
|
|
expected_hosts=['thor', 'odin', 'loki']
|
|
|
|
assert hosts == expected_hosts
|
|
|
|
assert hosts == expected_hosts
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_simple_ungrouped(self):
|
|
|
|
|
|
|
|
inventory = self.yaml_inventory()
|
|
|
|
|
|
|
|
hosts = inventory.list_hosts("ungrouped")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
expected_hosts=['jupiter']
|
|
|
|
|
|
|
|
assert hosts == expected_hosts
|
|
|
|
|
|
|
|
|
|
|
|
def test_yaml_combined(self):
|
|
|
|
def test_yaml_combined(self):
|
|
|
|
inventory = self.yaml_inventory()
|
|
|
|
inventory = self.yaml_inventory()
|
|
|
|
hosts = inventory.list_hosts("norse:greek")
|
|
|
|
hosts = inventory.list_hosts("norse:greek")
|
|
|
|