MCPcopy Create free account
hub / github.com/Kaggle/docker-python / test_user_provided_credentials

Method test_user_provided_credentials

tests/test_ucaip.py:14–24  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

12class TestUcaip(unittest.TestCase):
13
14 def test_user_provided_credentials(self):
15 credentials = _make_credentials()
16 env = EnvironmentVarGuard()
17 env.set('KAGGLE_USER_SECRETS_TOKEN', 'foobar')
18 env.set('KAGGLE_KERNEL_INTEGRATIONS', 'CLOUDAI')
19 with env:
20 from google.cloud import aiplatform
21 init_ucaip()
22 aiplatform.init(credentials=credentials)
23 self.assertNotIsInstance(aiplatform.initializer.global_config.credentials, KaggleKernelCredentials)
24 self.assertIsNotNone(aiplatform.initializer.global_config.credentials)

Callers

nothing calls this directly

Calls 2

init_ucaipFunction · 0.90
_make_credentialsFunction · 0.70

Tested by

no test coverage detected