List hosts in no group in the ungrouped group.

This commit is contained in:
Jeroen Hoekx
2012-04-16 10:55:08 +02:00
parent 3a24aa9a70
commit 961ccdb2f4
3 changed files with 32 additions and 1 deletions

View File

@@ -51,6 +51,13 @@ class TestInventory(unittest.TestCase):
expected_hosts=['thor', 'odin', 'loki']
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):
inventory = self.simple_inventory()
hosts = inventory.list_hosts("norse:greek")
@@ -176,6 +183,13 @@ class TestInventory(unittest.TestCase):
expected_hosts=['thor', 'odin', 'loki']
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):
inventory = self.yaml_inventory()
hosts = inventory.list_hosts("norse:greek")

View File

@@ -5,6 +5,8 @@
vars:
- moon: titan
- zeus
- group: greek
hosts:
- zeus