예제 #1
0
    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)
예제 #2
0
    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)