Exemple #1
0
 def test_create_2_token(self):
     auth = authenticator.create(
         username='******',
         password='******',
         token='3',
         auth_url='4',
         version='2',
         project_name='6',
     )
     self.assertEqual('3', auth.token)
     self.assertEqual('4', auth.auth_url)
def make_authenticate(opts):
    return authenticator.create(
        username=opts.username,
        password=opts.password,
        token=opts.token,
        auth_url=opts.auth_url,
        version=opts.identity_api_version,
        project_name=opts.project_name,
        domain_name=opts.domain_name,
        project_domain_name=opts.project_domain_name,
        user_domain_name=opts.user_domain_name,
    )
def make_authenticate(opts):
    return authenticator.create(
        username=opts.username,
        password=opts.password,
        token=opts.token,
        auth_url=opts.auth_url,
        version=opts.identity_api_version,
        project_name=opts.project_name,
        domain_name=opts.domain_name,
        project_domain_name=opts.project_domain_name,
        user_domain_name=opts.user_domain_name,
    )
Exemple #4
0
 def test_create_2_password(self):
     auth = authenticator.create(
         username='******',
         password='******',
         token=None,
         auth_url='4',
         version='2',
         project_name='6',
     )
     self.assertEqual('1', auth.username)
     self.assertEqual('2', auth.password)
     self.assertEqual('4', auth.auth_url)
     self.assertEqual('6', auth.tenant_name)
Exemple #5
0
 def test_create_3_password(self):
     auth = authenticator.create(
         username='******',
         password='******',
         token=None,
         auth_url='4',
         version='3',
         project_name='6',
         domain_name='7',
         project_domain_name='8',
         user_domain_name='9',
     )
     self.assertEqual('1', auth.auth_methods[0].username)
     self.assertEqual('2', auth.auth_methods[0].password)
     self.assertEqual('4', auth.auth_url)
     self.assertEqual('6', auth.project_name)
     self.assertEqual('7', auth.domain_name)
     self.assertEqual('8', auth.project_domain_name)
     self.assertEqual('9', auth.auth_methods[0].user_domain_name)
Exemple #6
0
 def create(cls, username=None, password=None, token=None, auth_url=None,
            version=None, project_name=None, verify=None, user_agent=None,
            region=None, domain_name=None, project_domain_name=None,
            user_domain_name=None):
     xport = transport.Transport(verify=verify, user_agent=user_agent)
     args = {
         'username': username,
         'password': password,
         'token': token,
         'auth_url': auth_url,
         'project_name': project_name,
         'domain_name': domain_name,
         'project_domain_name': project_domain_name,
         'user_domain_name': user_domain_name,
     }
     if version:
         args['version'] = version
     auth = authenticator.create(**args)
     preference = service_filter.ServiceFilter(region=region)
     return cls(xport, auth, preference=preference)