2
0

org_basic_test.lua 601 B

1234567891011121314151617181920212223
  1. dofile("../modpol.lua")
  2. print('\nRemoving existing orgs')
  3. modpol.orgs.reset()
  4. print('\nCreating an org called "test_org"')
  5. test_org = modpol.instance:add_org('test_org')
  6. print('\nTrying to create an org with the same name')
  7. duplicate = modpol.instance:add_org('test_org')
  8. print('\nAdding user "luke" to test_org')
  9. test_org:add_member('luke')
  10. print('\nTrying to add duplicate user to test_org')
  11. test_org:add_member('luke')
  12. print('\nRemoving user "luke" from test_org')
  13. test_org:remove_member('luke')
  14. print('\nTrying to remove user "luke" from empty member list')
  15. test_org:remove_member('luke')