Improve MaxCtrl test coverage

A few missing cases that simple to solve were reported by the coverage
tool.
This commit is contained in:
Markus Mäkelä
2018-08-10 21:46:38 +03:00
parent 46dee98b25
commit 57471c7baa
5 changed files with 32 additions and 1 deletions

View File

@ -16,7 +16,7 @@ describe("API", function() {
})
})
it('sums integer values', function() {
it('sums zero integer values', function() {
return doCommand('api get servers data[].attributes.statistics.connections --sum')
.then((res) => {
js = JSON.parse(res)
@ -24,6 +24,14 @@ describe("API", function() {
})
})
it('sums non-zero integer values', function() {
return doCommand('api get --sum maxscale/threads data[].attributes.stats.reads')
.then((res) => {
js = JSON.parse(res)
js.should.be.a('number')
})
})
it('does not sum string values', function() {
return doCommand('api get servers data[].id --sum')
.then((res) => {