(self, mock_access_token)
| 109 | |
| 110 | @patch.object(kaggle_secrets.UserSecretsClient, 'get_bigquery_access_token', return_value=('secret',1000)) |
| 111 | def test_simultaneous_clients(self, mock_access_token): |
| 112 | env = EnvironmentVarGuard() |
| 113 | env.set('KAGGLE_USER_SECRETS_TOKEN', 'foobar') |
| 114 | with env: |
| 115 | proxy_client = bigquery.Client(client_options={"api_endpoint": TestBigQuery.API_BASE_URL}) |
| 116 | bq_client = bigquery.Client( |
| 117 | project='ANOTHER_PROJECT', credentials=KaggleKernelCredentials(), client_options={"api_endpoint": TestBigQuery.API_BASE_URL}) |
| 118 | self._test_integration(bq_client) |
| 119 | # Verify that proxy client is still going to proxy to ensure global Connection |
| 120 | # isn't being modified. |
| 121 | self.assertNotEqual(type(proxy_client._connection), KaggleKernelCredentials) |
| 122 | self.assertEqual(type(proxy_client._connection), _DataProxyConnection) |
| 123 | |
| 124 | def test_no_project_with_connected_account(self): |
| 125 | env = EnvironmentVarGuard() |
nothing calls this directly
no test coverage detected