Improve messages for validation

Change-Id: Icce40f843e97ffff11c6f7e26438e94d7fed247b
Closes-bug: #1283289
This commit is contained in:
Vitaly Gridnev
2015-02-10 17:02:23 +03:00
parent 4ab4a449df
commit 0ce861f72c
3 changed files with 32 additions and 16 deletions

View File

@@ -37,6 +37,8 @@ class TestScalingValidation(u.ValidationTestCase):
super(TestScalingValidation, self).setUp()
api.plugin_base.setup_plugins()
self._create_object_fun = mock.Mock()
self.duplicates_detected = ("Duplicates in node group names are"
" detected: ['a']")
@mock.patch('sahara.service.api.get_cluster')
@mock.patch('sahara.plugins.base.PluginManager.get_plugin')
@@ -101,8 +103,7 @@ class TestScalingValidation(u.ValidationTestCase):
]})
self._assert_check_scaling(
data=data, cluster=cluster,
expected_message='Duplicates in node '
'group names are detected',
expected_message=self.duplicates_detected,
expected_exception=ex.InvalidDataException)
@mock.patch("sahara.service.api.OPS")
@@ -128,8 +129,7 @@ class TestScalingValidation(u.ValidationTestCase):
}
self._assert_check_scaling(
data=data, cluster=cluster,
expected_message='Duplicates in node '
'group names are detected',
expected_message=self.duplicates_detected,
expected_exception=ex.InvalidDataException)
data = {
'add_node_groups': [

View File

@@ -101,9 +101,8 @@ class TestNGTemplateCreateValidation(u.ValidationTestCase):
'node_processes': ['wrong_process']
},
bad_req_i=(1, 'INVALID_REFERENCE',
"Plugin supports the following node procesess: ["
"'datanode', 'hiveserver', 'jobtracker', 'namenode', "
"'oozie', 'secondarynamenode', 'tasktracker']")
"Plugin doesn't support the following node processes: "
"['wrong_process']")
)
def test_ng_template_create_v_right(self):