def test_load_pillar_dirs_no_target(self): pillar_locations = pillar.get_unrendered_pillar_locations() result = pillar.get_pillar_dirs(pillar_locations[1], pillar_locations[0]) for item in result: self.assertIn(item, env.project_pillar_dirs)
def test_get_rendered_pillar_location_with_target(self): target = 'does_not_exist' pillar_locations = pillar.get_unrendered_pillar_locations() result = pillar.get_pillar_dirs(pillar_locations[1], pillar_locations[0], target) self.assertEqual(result, []) for item in pillar_locations: self.assertNotIn(item, result)
def test_get_unrendered_pillar_locations_with_project(self): env.use_project_dir = True result = pillar.get_unrendered_pillar_location() pillar_locations = pillar.get_unrendered_pillar_locations() self.assertNotEqual(pillar_locations, env.pillar_dirs) tmp_pillar_dirs = list(env.pillar_dirs) tmp_pillar_dirs.insert(0, result) self.assertEqual(pillar_locations, tmp_pillar_dirs) env.project_pillar_dirs = list(tmp_pillar_dirs)
def test_get_unrendered_pillar_locations_no_project(self): env.use_project_dir = False self.assertEqual(pillar.get_unrendered_pillar_locations(False), env.pillar_dirs)