aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2018-09-26 12:36:46 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2018-09-26 12:36:46 +0200
commit8de7f11cf8c20c39c936791ac0401d03e1d5bb46 (patch)
treeda24a83efd4b91612cff79337270046d24784506
parentd2fbdb56883cb935b77d3dc04b5ab2f5d89a7b6f (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: Ic9ef9c1928fa658b15eceb43a464243d246f9b79 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r--conf.d/controller/lua.d/aft.lua21
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