本文整理汇总了Python中test_common.create_user函数的典型用法代码示例。如果您正苦于以下问题:Python create_user函数的具体用法?Python create_user怎么用?Python create_user使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了create_user函数的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
self.auth_token = utils.get_auth_token()
self.userdisabled = utils.get_userdisabled()
utils.create_tenant('test_tenant1', self.auth_token)
utils.create_tenant('test_tenant2', self.auth_token)
utils.create_user('test_tenant1', 'test_user1', self.auth_token)
utils.create_user('test_tenant1', 'test_user2', self.auth_token)
utils.add_user_json(self.auth_token)
开发者ID:Mirantis,项目名称:keystone,代码行数:8,代码来源:test_authentication.py
示例2: test_add_user_global_group_forbidden_xml
def test_add_user_global_group_forbidden_xml(self):
resp, content = utils.create_global_group(self.global_group, str(self.auth_token))
utils.create_user(self.tenant, self.user, str(self.auth_token))
resp_new, content_new = utils.add_user_global_group_xml(self.global_group, self.user, str(self.disabled_token))
if int(resp["status"]) == 500:
self.fail("IDM fault")
elif int(resp["status"]) == 503:
self.fail("Service Not Available")
self.assertEqual(403, int(resp_new["status"]))
开发者ID:juvvadi,项目名称:keystone,代码行数:9,代码来源:test_groups.py
示例3: test_add_user_global_group_xml
def test_add_user_global_group_xml(self):
resp, content = utils.create_global_group(self.global_group, str(self.auth_token))
utils.create_user(self.tenant, self.user, str(self.auth_token))
resp_new, content_new = utils.add_user_global_group_xml(self.global_group, self.user, str(self.auth_token))
if int(resp["status"]) == 500:
self.fail("IDM fault")
elif int(resp["status"]) == 503:
self.fail("Service Not Available")
if int(resp_new["status"]) not in (200, 201):
self.fail("Failed due to %d" % int(resp_new["status"]))
开发者ID:juvvadi,项目名称:keystone,代码行数:11,代码来源:test_groups.py
示例4: setUp
def setUp(self):
self.tenant = utils.get_global_tenant()
self.user = utils.get_user()
self.userdisabled = utils.get_userdisabled()
self.auth_token = utils.get_auth_token()
self.exp_auth_token = utils.get_exp_auth_token()
self.disabled_token = utils.get_disabled_token()
self.global_group = "test_global_group"
utils.create_tenant(self.tenant, str(self.auth_token))
utils.create_user(self.tenant, self.user, self.auth_token)
utils.add_user_json(self.tenant, self.user, self.auth_token)
self.token = utils.get_token(self.user, "secrete", self.tenant, "token")
开发者ID:juvvadi,项目名称:keystone,代码行数:12,代码来源:test_groups.py
示例5: test_get_users_global_group_unauthorized
def test_get_users_global_group_unauthorized(self):
resp, content = utils.create_global_group(self.global_group, str(self.auth_token))
utils.create_user(self.tenant, self.user, str(self.auth_token))
utils.add_user_global_group(self.global_group, self.user, str(self.auth_token))
resp_new, content_new = utils.get_user_global_group(self.global_group, str(self.token))
if int(resp["status"]) == 500:
self.fail("IDM fault")
elif int(resp["status"]) == 503:
self.fail("Service Not Available")
self.assertEqual(401, int(resp_new["status"]))
开发者ID:juvvadi,项目名称:keystone,代码行数:12,代码来源:test_groups.py
示例6: setUp
def setUp(self):
self.tenant = 'test_tenant'
self.auth_token = utils.get_auth_token()
self.user = utils.get_user()
self.userdisabled = utils.get_userdisabled()
self.exp_auth_token = utils.get_exp_auth_token()
self.disabled_token = utils.get_disabled_token()
utils.create_tenant(self.tenant, str(self.auth_token))
utils.create_user(self.tenant, self.user, self.auth_token)
utils.add_user_json(self.tenant, self.user, self.auth_token)
self.token = utils.get_token(self.user, 'secrete', self.tenant,
'token')
开发者ID:juvvadi,项目名称:keystone,代码行数:12,代码来源:test_tenants.py
示例7: test_add_user_global_group_forbidden_xml
def test_add_user_global_group_forbidden_xml(self):
resp, _content = utils.create_global_group(self.global_group,
str(self.auth_token))
utils.create_user(self.tenant, self.user, str(self.auth_token))
resp_new, _content_new = utils.add_user_global_group_xml(\
self.global_group,
self.user,
str(self.disabled_token))
if int(resp['status']) == 500:
self.fail('Identity Fault')
elif int(resp['status']) == 503:
self.fail('Service Not Available')
self.assertEqual(403, int(resp_new['status']))
开发者ID:mgius,项目名称:keystone,代码行数:13,代码来源:test_groups.py
示例8: test_add_user_global_group
def test_add_user_global_group(self):
resp, _content = utils.create_global_group(self.global_group,
str(self.auth_token))
utils.create_user(self.tenant, self.user, str(self.auth_token))
resp_new, _content_new = utils.add_user_global_group(self.global_group,
self.user,
str(self.auth_token))
if int(resp['status']) == 500:
self.fail('Identity Fault')
elif int(resp['status']) == 503:
self.fail('Service Not Available')
if int(resp_new['status']) not in (200, 201):
self.fail('Failed due to %d' % int(resp_new['status']))
开发者ID:mgius,项目名称:keystone,代码行数:14,代码来源:test_groups.py
示例9: test_add_user_global_group_unauthorized
def test_add_user_global_group_unauthorized(self):
resp, content = utils.create_global_group(self.global_group,
str(self.auth_token))
utils.create_user(self.tenant, self.user, str(self.auth_token))
resp_new, content_new = utils.add_user_global_group(self.global_group,
self.user,
str(self.token))
if int(resp['status']) == 500:
self.fail('Identity Fault')
elif int(resp['status']) == 503:
self.fail('Service Not Available')
self.assertEqual(401, int(resp_new['status']))
开发者ID:slashk,项目名称:keystone,代码行数:14,代码来源:test_groups.py
示例10: setUp
def setUp(self):
self.auth_token = utils.get_auth_token()
self.userdisabled = utils.get_userdisabled()
resp1, content1 = utils.create_tenant('test_tenant1', self.auth_token)
#create tenant2
resp2, content2 = utils.create_tenant('test_tenant2', self.auth_token)
#create user1 with tenant1
resp3, content3 = utils.create_user('test_tenant1', 'test_user1',
self.auth_token)
resp3, content3 = utils.create_user('test_tenant1', 'test_user2',
self.auth_token)
#add user1 to tenant2
resp4, content4 = utils.add_user_json('test_tenant2', 'test_user1',
self.auth_token)
开发者ID:slashk,项目名称:keystone,代码行数:14,代码来源:test_authentication.py
示例11: setUp
def setUp(self):
self.tenant = utils.get_tenant()
self.password = utils.get_password()
self.email = utils.get_email()
self.user = utils.get_user()
self.userdisabled = utils.get_userdisabled()
self.auth_token = utils.get_auth_token()
self.exp_auth_token = utils.get_exp_auth_token()
self.disabled_token = utils.get_disabled_token()
self.missing_token = utils.get_none_token()
self.invalid_token = utils.get_non_existing_token()
utils.create_tenant(self.tenant, str(self.auth_token))
utils.create_user(self.tenant, self.user, self.auth_token)
self.token = utils.get_token(self.user, 'secrete', self.tenant,
'token')
开发者ID:aabes,项目名称:keystone,代码行数:15,代码来源:test_BaseURLs.py
示例12: setUp
def setUp(self):
self.auth_token = utils.get_auth_token()
self.service_token = utils.get_service_token()
self.missing_token = utils.get_none_token()
self.invalid_token = utils.get_non_existing_token()
self.disabled_token = utils.get_disabled_token()
self.exp_auth_token = utils.get_exp_auth_token()
self.user = utils.get_user()
self.tenant = utils.get_tenant()
utils.create_tenant(self.tenant, str(self.auth_token))
utils.create_user(self.tenant, self.user, self.auth_token)
self.sample_service = 'sampleservice'
self.test_service = 'test_service'
self.token = utils.get_token(self.user, 'secrete', self.tenant,
'token')
utils.create_service(self.sample_service, str(self.auth_token))
开发者ID:Mirantis,项目名称:keystone,代码行数:16,代码来源:test_services.py
示例13: setUp
def setUp(self):
self.tenant = utils.get_tenant()
self.password = utils.get_password()
self.email = utils.get_email()
self.user = utils.get_user()
self.userdisabled = utils.get_userdisabled()
self.auth_token = utils.get_auth_token()
self.service_token = utils.get_service_token()
self.exp_auth_token = utils.get_exp_auth_token()
self.disabled_token = utils.get_disabled_token()
self.missing_token = utils.get_none_token()
self.invalid_token = utils.get_non_existing_token()
utils.create_tenant(self.tenant, str(self.auth_token))
utils.create_user(self.tenant, self.user, self.auth_token)
self.token = utils.get_token(self.user, "secrete", self.tenant, "token")
self.service_id = utils.get_test_service_id()
self.service_role = self.service_id + ":test_role"
开发者ID:Mirantis,项目名称:keystone,代码行数:17,代码来源:test_roles.py
示例14: test_delete_user_global_group_xml
def test_delete_user_global_group_xml(self):
h = httplib2.Http(".cache")
resp, content = utils.create_global_group(self.global_group, str(self.auth_token))
respG, contentG = utils.create_user(self.tenant, self.user, str(self.auth_token))
respG, contentG = utils.add_user_global_group(self.global_group, self.user, str(self.auth_token))
respG, contentG = utils.delete_user_global_group_xml(self.global_group, self.user, str(self.auth_token))
if int(resp["status"]) == 500:
self.fail("IDM fault")
elif int(resp["status"]) == 503:
self.fail("Service Not Available")
self.assertEqual(204, int(respG["status"]))
开发者ID:roarking,项目名称:keystone,代码行数:11,代码来源:test_groups.py
示例15: test_add_user_global_group
def test_add_user_global_group(self):
h = httplib2.Http(".cache")
resp, content = utils.create_global_group(self.global_group, str(self.auth_token))
respG, contentG = utils.create_user(self.tenant, self.user, str(self.auth_token))
respG, contentG = utils.add_user_global_group(self.global_group, self.user, str(self.auth_token))
if int(resp["status"]) == 500:
self.fail("IDM fault")
elif int(resp["status"]) == 503:
self.fail("Service Not Available")
if int(respG["status"]) not in (200, 201):
self.fail("Failed due to %d" % int(respG["status"]))
开发者ID:roarking,项目名称:keystone,代码行数:12,代码来源:test_groups.py
示例16: setUp
def setUp(self):
self.tenant = utils.get_tenant()
self.password = utils.get_password()
self.email = utils.get_email()
self.user = utils.get_user()
self.userdisabled = utils.get_userdisabled()
self.auth_token = utils.get_auth_token()
self.service_token = utils.get_service_token()
self.exp_auth_token = utils.get_exp_auth_token()
self.disabled_token = utils.get_disabled_token()
self.missing_token = utils.get_none_token()
self.invalid_token = utils.get_non_existing_token()
utils.create_tenant(self.tenant, str(self.auth_token))
utils.create_user(self.tenant, self.user, self.auth_token)
self.token = utils.get_token(self.user, 'secrete', self.tenant,
'token')
self.region = 'DFW'
self.service = utils.get_test_service_id()
self.public_url = 'public'
self.admin_url = 'admin'
self.internal_url = 'internal'
self.enabled = True
self.is_global = False
开发者ID:Cerberus98,项目名称:keystone,代码行数:23,代码来源:test_endpoints.py
示例17: setUp
def setUp(self):
self.tenant = utils.get_tenant()
self.password = utils.get_password()
self.email = utils.get_email()
self.user = utils.get_user()
self.userdisabled = utils.get_userdisabled()
self.auth_token = utils.get_auth_token()
self.service_token = utils.get_service_token()
self.exp_auth_token = utils.get_exp_auth_token()
self.disabled_token = utils.get_disabled_token()
self.missing_token = utils.get_none_token()
self.invalid_token = utils.get_non_existing_token()
utils.create_tenant(self.tenant, str(self.auth_token))
utils.create_user(self.tenant, self.user, self.auth_token)
self.token = utils.get_token(self.user, 'secrete', self.tenant,
'token')
self.region = 'DFW'
self.service = utils.get_test_service_id()
self.public_url = 'public'
self.admin_url = 'admin'
self.internal_url = 'internal'
self.enabled = True
self.is_global = False
resp, content = utils.create_endpoint_template(\
self.region, self.service, self.public_url,\
self.admin_url, self.internal_url,\
self.enabled, self.is_global, self.auth_token)
self.assertEqual(201, int(resp['status']))
obj = json.loads(content)
if not "endpointTemplate" in obj:
raise fault.BadRequestFault("Expecting endpointTemplate")
endpoint_template = obj["endpointTemplate"]
if not "id" in endpoint_template:
self.endpoint_template_id = None
else:
self.endpoint_template_id = endpoint_template["id"]
开发者ID:vishvananda,项目名称:keystone,代码行数:36,代码来源:test_endpoints.py
注:本文中的test_common.create_user函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论