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

Method test_fn

tests/test_user_secrets.py:150–165  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

148 return result.stdout.strip().decode('ascii')
149
150 def test_fn():
151 client = UserSecretsClient()
152 client.set_gcloud_credentials(project=project, account=account)
153
154 self.assertEqual(project, os.environ['GOOGLE_CLOUD_PROJECT'])
155 self.assertEqual(project, get_gcloud_config_value('project'))
156
157 self.assertEqual(account, os.environ['GOOGLE_ACCOUNT'])
158 self.assertEqual(account, get_gcloud_config_value('account'))
159
160 expected_creds_file = '/tmp/gcloud_credential.json'
161 self.assertEqual(expected_creds_file, os.environ['GOOGLE_APPLICATION_CREDENTIALS'])
162 self.assertEqual(expected_creds_file, get_gcloud_config_value('auth/credential_file_override'))
163
164 with open(expected_creds_file, 'r') as f:
165 self.assertEqual(secret, '\n'.join(f.readlines()))
166
167 self._test_client(test_fn, '/requests/GetUserSecretByLabelRequest', {'Label': "__gcloud_sdk_auth__"}, secret=secret)
168

Callers

nothing calls this directly

Calls 4

get_gcloud_credentialMethod · 0.95
UserSecretsClientClass · 0.90

Tested by

no test coverage detected