From c3aae9cf738846563a0d6b5abb4a3aed55110fcc Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 26 Sep 2018 12:36:46 +0200 Subject: 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 --- conf.d/controller/lua.d/aft.lua | 21 +++++++++++++++------ 1 file 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 -- cgit 1.2.3-korg