diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2018-09-26 12:36:46 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2018-10-10 10:53:48 +0200 |
commit | c3aae9cf738846563a0d6b5abb4a3aed55110fcc (patch) | |
tree | 6f59eb1d9e55bb76131ec1319d3be1be43b6d33e /conf.d/controller/lua.d/aft.lua | |
parent | c541040fb5fa1b5333edb3755914428aa0af36ff (diff) |
Separation between CB and classic test functions
Without that separation you need to specify a nil argument
before your setUp and tearDown functions in your test definition.
Change-Id: Ied7d5b057075478ccf2c4cefc954e9a0f6814bb7
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'conf.d/controller/lua.d/aft.lua')
-rw-r--r-- | conf.d/controller/lua.d/aft.lua | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/conf.d/controller/lua.d/aft.lua b/conf.d/controller/lua.d/aft.lua index a76bf45..d4f18be 100644 --- a/conf.d/controller/lua.d/aft.lua +++ b/conf.d/controller/lua.d/aft.lua @@ -378,17 +378,28 @@ function _AFT.assertVerbError(api, verb, args, cb) end end -function _AFT.testVerb(testName, api, verb, args, cb, setUp, tearDown) +function _AFT.testVerbCb(testName, api, verb, args, cb, setUp, tearDown) _AFT.describe(testName, function() _AFT.assertVerb(api, verb, args, cb) end, setUp, tearDown) end -function _AFT.testVerbError(testName, api, verb, args, cb, setUp, tearDown) +function _AFT.testVerbCbError(testName, api, verb, args, cb, setUp, tearDown) _AFT.describe(testName, function() - _AFT.assertVerbError(api, verb, args, cb) - end, setUp, tearDown) + _AFT.assertVerbError(api, verb, args, cb) + end, setUp, tearDown) +end + +function _AFT.testVerb(testName, api, verb, args, setUp, tearDown) + _AFT.describe(testName, function() + _AFT.assertVerb(api, verb, args) + end, setUp, tearDown) +end +function _AFT.testVerbError(testName, api, verb, args, setUp, tearDown) + _AFT.describe(testName, function() + _AFT.assertVerbError(api, verb, args) + end, setUp, tearDown) end function _AFT.describe(testName, testFunction, setUp, tearDown) @@ -556,10 +567,8 @@ local _AFT_list_of_funcs = { { 'assertVerbError', 'assertVerbCbError' }, { 'testVerb', 'testVerbStatusSuccess' }, { 'testVerb', 'testVerbResponseEquals' }, - { 'testVerb', 'testVerbCb' }, { 'testVerbError', 'testVerbStatusError' }, { 'testVerbError', 'testVerbResponseEqualsError' }, - { 'testVerbError', 'testVerbCbError' }, } -- Import all luaunit assertion function to _AFT object |