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

Method test_simultaneous_clients

tests/test_bigquery.py:111–122  ·  view source on GitHub ↗
(self, mock_access_token)

Source from the content-addressed store, hash-verified

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()

Callers

nothing calls this directly

Calls 2

_test_integrationMethod · 0.95

Tested by

no test coverage detected