def test_nodes_with_role_in_env(self): """Should return a filtered list of nodes when an env is given""" runner.env.chef_environment = "staging" runner.nodes_with_role("all_you_can_eat") self.assertEquals(runner.env.hosts, ['testnode2'])
def test_nodes_with_role_in_env_not_found(self): """Should abort when no nodes with given role found in the environment """ runner.env.chef_environment = "production" runner.nodes_with_role('base')
def test_nodes_with_role(self): """Should return a list of nodes with the given role in the run_list""" runner.nodes_with_role("all_you_can_eat") self.assertEquals(runner.env.hosts, ['testnode2'])
def test_nodes_with_role(self): """Should return a list of nodes with the given role in the run_list""" runner.nodes_with_role('base') self.assertEqual(runner.env.hosts, ['nestedroles1', 'testnode2'])
def test_nodes_with_role_in_env(self): """Should return a filtered list of nodes with role when an env is given """ runner.env.chef_environment = "staging" runner.nodes_with_role('base') self.assertEqual(runner.env.hosts, ['testnode2'])