Added working test of nested poll function on CLI
This commit is contained in:
parent
4e10d74bff
commit
82226f71b1
24
modpol/tests/nested_functions.lua
Normal file
24
modpol/tests/nested_functions.lua
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
dofile("../modpol.lua")
|
||||||
|
|
||||||
|
print('\nRemoving existing orgs')
|
||||||
|
modpol.orgs.reset()
|
||||||
|
|
||||||
|
print('\nCreating an org called "test_org"')
|
||||||
|
test_org = modpol.instance:add_org('test_org', 'luke')
|
||||||
|
|
||||||
|
print('\nAdding user "nathan" to test_org')
|
||||||
|
test_org:add_member('nathan')
|
||||||
|
|
||||||
|
print('\nTrying to remove user "nathan" from empty member list')
|
||||||
|
test_org:remove_member('nathan')
|
||||||
|
|
||||||
|
print('\nInteractive test poll with nested functions...')
|
||||||
|
modpol.interactions.text_query(
|
||||||
|
"nathan","Poll question:",
|
||||||
|
function(input)
|
||||||
|
modpol.interactions.binary_poll_user(
|
||||||
|
"nathan", input,
|
||||||
|
function(response)
|
||||||
|
print("Poll successful!")
|
||||||
|
end)
|
||||||
|
end)
|
Loading…
x
Reference in New Issue
Block a user