MCPcopy Index your code
hub / github.com/Kaggle/docker-python / test_user_provided_credentials

Method test_user_provided_credentials

tests/test_vision.py:37–46  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

35
36 @patch("google.cloud.vision.ImageAnnotatorClient", new=FakeClient)
37 def test_user_provided_credentials(self):
38 credentials = _make_credentials()
39 env = EnvironmentVarGuard()
40 env.set('KAGGLE_USER_SECRETS_TOKEN', 'foobar')
41 env.set('KAGGLE_KERNEL_INTEGRATIONS', 'CLOUDAI')
42 with env:
43 init_vision()
44 client = vision.ImageAnnotatorClient(credentials=credentials)
45 self.assertNotIsInstance(client.credentials, KaggleKernelCredentials)
46 self.assertIsNotNone(client.credentials)
47
48 def test_monkeypatching_succeed(self):
49 env = EnvironmentVarGuard()

Callers

nothing calls this directly

Calls 2

init_visionFunction · 0.90
_make_credentialsFunction · 0.70

Tested by

no test coverage detected