Improve messages for validation
Change-Id: Icce40f843e97ffff11c6f7e26438e94d7fed247b Closes-bug: #1283289
This commit is contained in:
@@ -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': [
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user