

def test_group_by_hosts_with_env(self):
    'Should group guests in env by hosts when env is given'
    data = chef.group_nodes_by_host(chef.get_nodes_extended(), env='staging')
    self.assertEqual(len(data), 1)
    for host in data:
        self.assertEqual(host['virtualization']['role'], 'host')
    expected_vms = ['testnode4']
    self.assertEqual(len(data[0]['virtualization']['guests']), 3)

dataset/ETHPy150Open edelight/kitchen/kitchen/backends/tests.py TestData.test_group_by_hosts_with_env/original