Skip to content

Commit 3d05ffa

Browse files
sararobcopybara-github
authored andcommitted
chore: add tests for private AE methods
PiperOrigin-RevId: 882588681
1 parent 0d6c54e commit 3d05ffa

4 files changed

Lines changed: 131 additions & 0 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# pylint: disable=protected-access,bad-continuation,missing-function-docstring
16+
17+
from tests.unit.vertexai.genai.replays import pytest_helper
18+
from vertexai._genai import types
19+
20+
21+
def test_private_create_with_labels(client):
22+
labels = {"test-label": "test-value"}
23+
agent_engine_operation = client.agent_engines._create(
24+
config={"labels": labels},
25+
)
26+
assert isinstance(agent_engine_operation, types.AgentEngineOperation)
27+
28+
29+
pytestmark = pytest_helper.setup(
30+
file=__file__,
31+
globals_for_file=globals(),
32+
test_method="agent_engines._create",
33+
)
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# pylint: disable=protected-access,bad-continuation,missing-function-docstring
16+
17+
from tests.unit.vertexai.genai.replays import pytest_helper
18+
from vertexai._genai import types
19+
20+
21+
def test_private_delete(client):
22+
agent_engine_operation = client.agent_engines._delete(
23+
name="reasoningEngines/7571341522470174720",
24+
)
25+
assert isinstance(agent_engine_operation, types.DeleteAgentEngineOperation)
26+
27+
28+
pytestmark = pytest_helper.setup(
29+
file=__file__,
30+
globals_for_file=globals(),
31+
test_method="agent_engines._delete",
32+
)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# pylint: disable=protected-access,bad-continuation,missing-function-docstring
16+
17+
from tests.unit.vertexai.genai.replays import pytest_helper
18+
from vertexai._genai import types
19+
20+
21+
def test_private_get(client):
22+
agent_engine = client.agent_engines._get(
23+
name="reasoningEngines/2886612747586371584",
24+
)
25+
assert isinstance(agent_engine, types.ReasoningEngine)
26+
assert agent_engine.labels == {"test-label": "test-value"}
27+
28+
29+
pytestmark = pytest_helper.setup(
30+
file=__file__,
31+
globals_for_file=globals(),
32+
test_method="agent_engines._get",
33+
)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# Copyright 2025 Google LLC
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
#
15+
# pylint: disable=protected-access,bad-continuation,missing-function-docstring
16+
17+
from tests.unit.vertexai.genai.replays import pytest_helper
18+
from vertexai._genai import types
19+
20+
21+
def test_private_update(client):
22+
agent_engine_operation = client.agent_engines._update(
23+
name="reasoningEngines/2886612747586371584",
24+
config=types.UpdateAgentEngineConfig(display_name="test-agent-engine-updated"),
25+
)
26+
assert isinstance(agent_engine_operation, types.AgentEngineOperation)
27+
28+
29+
pytestmark = pytest_helper.setup(
30+
file=__file__,
31+
globals_for_file=globals(),
32+
test_method="agent_engines._update",
33+
)

0 commit comments

Comments
 (0)