def test_activate_flavor_not_in_distros(self): flavor = 'not_ubuntu' error_msg = ('Wrong cobbler profile passed: {0} \n ' 'possible profiles: \{1}'.format( flavor, list(consts.DISTROS.keys()))) with self.assertRaisesRegexp(errors.WrongCobblerProfile, error_msg): bs_image._activate_flavor(flavor)
def test_activate_flavor_not_in_distros(self): flavor = 'not_ubuntu' error_msg = ('Wrong cobbler profile passed: {0} \n ' 'possible profiles: \{1}'. format(flavor, list(consts.DISTROS.keys()))) with self.assertRaisesRegexp(errors.WrongCobblerProfile, error_msg): bs_image._activate_flavor(flavor)
def test_activate_flavor(self, execute_mock, run_puppet_mock, update_astute_yaml_mock): flavor = 'ubuntu' bs_image._activate_flavor(flavor) update_astute_yaml_mock.assert_called_once_with( consts.DISTROS[flavor]['astute_flavor']) run_puppet_mock.assert_any_call(consts.COBBLER_MANIFEST) run_puppet_mock.assert_any_call(consts.ASTUTE_MANIFEST) self.assertEqual(2, run_puppet_mock.call_count) execute_mock.assert_called_once_with('service', 'astute', 'restart')