From 0666c0f0c9f3361641c4d178cdbf5bdf66d61143 Mon Sep 17 00:00:00 2001 From: Langfun Authors Date: Mon, 2 Dec 2024 11:32:04 -0800 Subject: [PATCH] Fix test case that called gcp_corp_access. PiperOrigin-RevId: 702033307 --- langfun/core/llms/vertexai_test.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/langfun/core/llms/vertexai_test.py b/langfun/core/llms/vertexai_test.py index 8a04d2f..de9ff56 100644 --- a/langfun/core/llms/vertexai_test.py +++ b/langfun/core/llms/vertexai_test.py @@ -426,6 +426,7 @@ def test_model_hub(self): model, ) + @mock.patch.object(vertexai.VertexAIRest, 'credentials', new=True) def test_project_and_location_check(self): with self.assertRaisesRegex(ValueError, 'Please specify `project`'): _ = vertexai.VertexAIGeminiPro1()._api_initialized @@ -496,6 +497,7 @@ def test_generation_config(self): lf.LMSamplingOptions(), ) + @mock.patch.object(vertexai.VertexAIRest, 'credentials', new=True) def test_call_model(self): with mock.patch('requests.Session.post') as mock_generate: mock_generate.side_effect = mock_requests_post