本文整理汇总了Python中test_common.add_user_global_group函数的典型用法代码示例。如果您正苦于以下问题:Python add_user_global_group函数的具体用法?Python add_user_global_group怎么用?Python add_user_global_group使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了add_user_global_group函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_delete_user_global_group_xml
def test_delete_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))
utils.add_user_global_group(self.global_group, self.user, str(self.auth_token))
resp_new, content_new = 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(resp_new["status"]))
示例2: test_get_users_global_group_forbidden
def test_get_users_global_group_forbidden(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.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"]))
示例3: test_add_user_global_group_conflict
def test_add_user_global_group_conflict(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.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")
self.assertEqual(409, int(respG["status"]))
示例4: test_get_users_global_group_expired_xml
def test_get_users_global_group_expired_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))
utils.add_user_global_group(self.global_group, self.user,
str(self.auth_token))
resp_new, _content_new = utils.get_user_global_group_xml(\
self.global_group,
str(self.exp_auth_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']))
示例5: test_add_user_global_group_conflict
def test_add_user_global_group_conflict(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.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')
self.assertEqual(409, int(resp_new['status']))
示例6: test_delete_user_global_group_notfound_xml
def test_delete_user_global_group_notfound_xml(self):
resp, _content = utils.create_global_group(self.global_group,
str(self.auth_token))
if int(resp['status']) == 500:
self.fail('Identity Fault')
elif int(resp['status']) == 503:
self.fail('Service Not Available')
utils.create_user(self.tenant, self.user, str(self.auth_token))
utils.add_user_global_group(self.global_group, self.user,
str(self.disabled_token))
utils.delete_user_global_group(self.global_group, self.user,
str(self.auth_token))
resp_new, _content_new = utils.delete_user_global_group_xml(\
self.global_group, self.user,
str(self.auth_token))
self.assertEqual(404, int(resp_new['status']))
示例7: 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("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"]))
示例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']))