本文整理汇总了Python中test_common.get_token函数的典型用法代码示例。如果您正苦于以下问题:Python get_token函数的具体用法?Python get_token怎么用?Python get_token使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_token函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_multi_token
def test_multi_token(self):
#get token for user1 with tenant1
token1 = utils.get_token('test_user1', 'secrete', 'test_tenant1',\
'token')
#get token for user 1 with tenant2
token2 = utils.get_token('test_user1', 'secrete', 'test_tenant2',\
'token')
#test result :: both token should be different
self.assertNotEqual(token1, None)
self.assertNotEqual(token2, None)
self.assertNotEqual(token1, token2)
resp = utils.delete_token(token1, self.auth_token)
resp = utils.delete_token(token2, self.auth_token)
示例2: setUp
def setUp(self):
self.tenant = utils.get_tenant()
self.token = utils.get_token('joeuser', 'secrete', self.tenant,
'token')
#self.user = utils.get_user()
self.userdisabled = utils.get_userdisabled()
self.auth_token = utils.get_auth_token()
示例3: setUp
def setUp(self):
self.token = utils.get_token("joeuser", "secrete", "token")
self.tenant = utils.get_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()
示例4: setUp
def setUp(self):
self.token = utils.get_token('joeuser', 'secrete', 'token')
self.tenant = 'test_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()
示例5: setUp
def setUp(self):
self.token = utils.get_token("joeuser", "secrete", "token")
self.globaltenant = 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_add"
示例6: setUp
def setUp(self):
self.tenant = utils.get_tenant()
self.token = utils.get_token(
'joeuser', 'secrete', self.tenant, 'token')
self.userdisabled = utils.get_userdisabled()
self.auth_token = utils.get_auth_token()
utils.delete_all_endpoint(self.tenant, self.auth_token)
utils.create_endpoint(self.tenant, "1", str(self.auth_token))
utils.create_endpoint(self.tenant, "2", str(self.auth_token))
utils.create_endpoint(self.tenant, "3", str(self.auth_token))
utils.create_endpoint(self.tenant, "4", str(self.auth_token))
示例7: test_a_authorize
def test_a_authorize(self):
resp, content = utils.get_token('joeuser', 'secrete', self.tenant)
self.assertEqual(200, int(resp['status']))
obj = content
if not "auth" in obj:
raise fault.BadRequestFault("Expecting Auth")
auth = obj["auth"]
if not "serviceCatalog" in auth:
raise fault.BadRequestFault("Expecting Service Catalog")
self.assertEqual('application/json', utils.content_type(resp))
示例8: 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")
示例9: 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')
示例10: setUp
def setUp(self):
self.tenant = utils.get_tenant()
self.token = utils.get_token('joeuser', 'secrete', self.tenant,
'token')
#self.user = utils.get_user()
self.userdisabled = utils.get_userdisabled()
self.auth_token = utils.get_auth_token()
utils.create_baseurls_ref(self.tenant, "1",
str(self.auth_token))
utils.create_baseurls_ref(self.tenant, "2",
str(self.auth_token))
utils.create_baseurls_ref(self.tenant, "3",
str(self.auth_token))
utils.create_baseurls_ref(self.tenant, "4",
str(self.auth_token))
示例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')
示例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))
示例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"
示例14: setUp
def setUp(self):
self.tenant = utils.get_tenant()
self.user = 'joeuser'
self.token = utils.get_token('joeuser', 'secrete', self.tenant,
'token')
self.auth_token = utils.get_auth_token()
self.exp_auth_token = utils.get_exp_auth_token()
_resp, content = utils.create_role_ref(self.user, 'Admin', self.tenant,
str(self.auth_token))
obj = json.loads(content)
if not "roleRef" in obj:
raise fault.BadRequestFault("Expecting RoleRef")
roleRef = obj["roleRef"]
if not "id" in roleRef:
self.role_ref_id = None
else:
self.role_ref_id = roleRef["id"]
示例15: 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