Add missing maxctrl test cases
Code coverage revealed that some parts of the code could be easily tested. Added these missing test cases and removed some dead code.
This commit is contained in:
@ -171,10 +171,8 @@ exports.builder = function(yargs) {
|
||||
|
||||
var err = false;
|
||||
|
||||
if (argv.params) {
|
||||
err = validateParams(argv, argv.params)
|
||||
monitor.data.attributes.parameters = argv.params.reduce(to_obj, {})
|
||||
}
|
||||
err = validateParams(argv, argv.params)
|
||||
monitor.data.attributes.parameters = argv.params.reduce(to_obj, {})
|
||||
|
||||
if (argv.servers) {
|
||||
for (i = 0; i < argv.servers.length; i++) {
|
||||
@ -265,14 +263,12 @@ exports.builder = function(yargs) {
|
||||
}
|
||||
}
|
||||
|
||||
if (argv.params) {
|
||||
var err = validateParams(argv, argv.params)
|
||||
if (err) {
|
||||
return Promise.reject(err)
|
||||
}
|
||||
|
||||
filter.data.attributes.parameters = argv.params.reduce(to_obj, {})
|
||||
var err = validateParams(argv, argv.params)
|
||||
if (err) {
|
||||
return Promise.reject(err)
|
||||
}
|
||||
filter.data.attributes.parameters = argv.params.reduce(to_obj, {})
|
||||
|
||||
|
||||
return doRequest(host, 'filters', null, {method: 'POST', body: filter})
|
||||
})
|
||||
|
Reference in New Issue
Block a user