(self)
| 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() |
nothing calls this directly
no test coverage detected