def test_required_param_not_set(self): param = cmn_tdef.ParameterMapping('test', cluster_template_attr='test', required=True) mock_cluster_template = mock.MagicMock() mock_cluster_template.test = None self.assertRaises(exception.RequiredParameterNotProvided, param.set_param, {}, mock_cluster_template, None)
def test_required_param_not_set(self): param = cmn_tdef.ParameterMapping('test', baymodel_attr='test', required=True) mock_baymodel = mock.MagicMock() mock_baymodel.test = None self.assertRaises(exception.RequiredParameterNotProvided, param.set_param, {}, mock_baymodel, None)