organizations: add endpoint list_roots

This commit is contained in:
Ashley Gould 2018-07-15 10:31:16 -07:00
commit 6c0c6148f1
6 changed files with 122 additions and 8 deletions

View file

@ -5,6 +5,7 @@ from moto.organizations import utils
ORG_ID_REGEX = r'o-[a-z0-9]{%s}' % utils.ORG_ID_SIZE
ROOT_ID_REGEX = r'r-[a-z0-9]{%s}' % utils.ROOT_ID_SIZE
OU_ID_REGEX = r'ou-[a-z0-9]{%s}-[a-z0-9]{%s}' % (utils.ROOT_ID_SIZE, utils.OU_ID_SUFFIX_SIZE)
ACCOUNT_ID_REGEX = r'[0-9]{%s}' % utils.ACCOUNT_ID_SIZE
CREATE_ACCOUNT_STATUS_ID_REGEX = r'car-[a-z0-9]{%s}' % utils.CREATE_ACCOUNT_STATUS_ID_SIZE
@ -15,8 +16,14 @@ def test_make_random_org_id():
def test_make_random_root_id():
org_id = utils.make_random_root_id()
org_id.should.match(ROOT_ID_REGEX)
root_id = utils.make_random_root_id()
root_id.should.match(ROOT_ID_REGEX)
def test_make_random_ou_id():
root_id = utils.make_random_root_id()
ou_id = utils.make_random_ou_id(root_id)
ou_id.should.match(OU_ID_REGEX)
def test_make_random_account_id():