org_basic_test.lua 631 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', 'luke')
  6. print('\nTrying to create an org with the same name')
  7. duplicate = modpol.instance:add_org('test_org', 'luke')
  8. print('\nAdding user "nathan" to test_org')
  9. test_org:add_member('nathan')
  10. print('\nTrying to add duplicate user to test_org')
  11. test_org:add_member('nathan')
  12. print('\nRemoving user "nathan" from test_org')
  13. test_org:remove_member('nathan')
  14. print('\nTrying to remove user "nathan" from empty member list')
  15. test_org:remove_member('nathan')