def test_trust_init(self):
        self.stub_auth(json=client_fixtures.trust_token())

        c = client.Client(user_domain_name='exampledomain',
                          username='******',
                          password='******',
                          auth_url=self.TEST_URL,
                          trust_id='fe0aef')
        self.assertIsNotNone(c.auth_ref)
        self.assertFalse(c.auth_ref.domain_scoped)
        self.assertFalse(c.auth_ref.project_scoped)
        self.assertEqual(c.auth_ref.trust_id, 'fe0aef')
        self.assertEqual(c.auth_ref.trustee_user_id, '0ca8f6')
        self.assertEqual(c.auth_ref.trustor_user_id, 'bd263c')
        self.assertTrue(c.auth_ref.trust_scoped)
        self.assertEqual(c.auth_user_id, '0ca8f6')
    def test_trust_init(self):
        self.stub_auth(json=client_fixtures.trust_token())

        c = client.Client(user_domain_name='exampledomain',
                          username='******',
                          password='******',
                          auth_url=self.TEST_URL,
                          trust_id='fe0aef')
        self.assertIsNotNone(c.auth_ref)
        self.assertFalse(c.auth_ref.domain_scoped)
        self.assertFalse(c.auth_ref.project_scoped)
        self.assertEqual(c.auth_ref.trust_id, 'fe0aef')
        self.assertEqual(c.auth_ref.trustee_user_id, '0ca8f6')
        self.assertEqual(c.auth_ref.trustor_user_id, 'bd263c')
        self.assertTrue(c.auth_ref.trust_scoped)
        self.assertEqual(c.auth_user_id, '0ca8f6')
Beispiel #3
0
    def test_trust_init(self):
        token = client_fixtures.trust_token()
        self.stub_auth(json=token)

        # Creating a HTTPClient not using session is deprecated.
        with self.deprecations.expect_deprecations_here():
            c = client.Client(user_domain_name=token.user_domain_name,
                              username=token.user_name,
                              password='******',
                              auth_url=self.TEST_URL,
                              trust_id=token.trust_id)
        self.assertIsNotNone(c.auth_ref)
        self.assertFalse(c.auth_ref.domain_scoped)
        self.assertFalse(c.auth_ref.project_scoped)
        self.assertEqual(token.trust_id, c.auth_ref.trust_id)
        self.assertEqual(token.trustee_user_id, c.auth_ref.trustee_user_id)
        self.assertEqual(token.trustor_user_id, c.auth_ref.trustor_user_id)
        self.assertTrue(c.auth_ref.trust_scoped)
        self.assertEqual(token.user_id, c.auth_user_id)
    def test_trust_init(self):
        token = client_fixtures.trust_token()
        self.stub_auth(json=token)

        # Creating a HTTPClient not using session is deprecated.
        with self.deprecations.expect_deprecations_here():
            c = client.Client(user_domain_name=token.user_domain_name,
                              username=token.user_name,
                              password='******',
                              auth_url=self.TEST_URL,
                              trust_id=token.trust_id)
        self.assertIsNotNone(c.auth_ref)
        self.assertFalse(c.auth_ref.domain_scoped)
        self.assertFalse(c.auth_ref.project_scoped)
        self.assertEqual(token.trust_id, c.auth_ref.trust_id)
        self.assertEqual(token.trustee_user_id, c.auth_ref.trustee_user_id)
        self.assertEqual(token.trustor_user_id, c.auth_ref.trustor_user_id)
        self.assertTrue(c.auth_ref.trust_scoped)
        self.assertEqual(token.user_id, c.auth_user_id)