MXS-1300: Reorganize and refactor tests
The tests are now sorted by command type. This allows for more consistent test creation as tests can be done per source code file instead of per object type. Added helper functions for common testing operations. The two main ones are doCommand, which executes a MaxCtrl command and returns a result, and verifyCommand, that executes a command and verifies the result via the REST API.
This commit is contained in:
20
maxctrl/test/enabledisable.js
Normal file
20
maxctrl/test/enabledisable.js
Normal file
@ -0,0 +1,20 @@
|
||||
require('../test_utils.js')()
|
||||
|
||||
var ctrl = require('../lib/core.js')
|
||||
var opts = { extra_args: [ '--quiet'] }
|
||||
|
||||
describe("Enable/Disable Commands", function() {
|
||||
before(startMaxScale)
|
||||
|
||||
it('disable with bad parameter', function() {
|
||||
return doCommand('disable log-priority bad-stuff')
|
||||
.should.be.rejected
|
||||
})
|
||||
|
||||
it('enable with bad parameter', function() {
|
||||
return doCommand('enable log-priority bad-stuff')
|
||||
.should.be.rejected
|
||||
})
|
||||
|
||||
after(stopMaxScale)
|
||||
});
|
Reference in New Issue
Block a user