Skip to content

Commit 10cd49b

Browse files
sararobcopybara-github
authored andcommitted
chore: add tests for private AE sessions methods
PiperOrigin-RevId: 882728088
1 parent 3d05ffa commit 10cd49b

4 files changed

Lines changed: 133 additions & 0 deletions

File tree

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_delete_session_non_blocking(client):
22+
ae_session_operation = client.agent_engines.sessions.delete(
23+
name=("reasoningEngines/2886612747586371584/sessions/8521561049109889024"),
24+
)
25+
assert isinstance(ae_session_operation, types.DeleteAgentEngineSessionOperation)
26+
27+
28+
pytestmark = pytest_helper.setup(
29+
file=__file__,
30+
globals_for_file=globals(),
31+
test_method="agent_engines.sessions.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_create_session(client):
22+
ae_session_operation = client.agent_engines.sessions._create(
23+
name="projects/964831358985/locations/us-central1/reasoningEngines/2886612747586371584",
24+
user_id="test-user-id",
25+
)
26+
assert isinstance(ae_session_operation, types.AgentEngineSessionOperation)
27+
28+
29+
pytestmark = pytest_helper.setup(
30+
file=__file__,
31+
globals_for_file=globals(),
32+
test_method="agent_engines.sessions._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_get_session_operation(client):
22+
ae_session_operation = client.agent_engines.sessions._get_session_operation(
23+
operation_name="reasoningEngines/2886612747586371584/sessions/3080649749292908544/operations/758783840595476480",
24+
)
25+
assert isinstance(ae_session_operation, types.AgentEngineSessionOperation)
26+
27+
28+
pytestmark = pytest_helper.setup(
29+
file=__file__,
30+
globals_for_file=globals(),
31+
test_method="agent_engines.sessions._get_session_operation",
32+
)
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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_session(client):
22+
agent_engine_session_operation = client.agent_engines.sessions._update(
23+
name="reasoningEngines/2886612747586371584/sessions/3080649749292908544",
24+
config=types.UpdateAgentEngineSessionConfig(
25+
display_name="test-agent-engine-session-updated",
26+
user_id="test-user-id",
27+
),
28+
)
29+
assert isinstance(agent_engine_session_operation, types.AgentEngineSessionOperation)
30+
31+
32+
pytestmark = pytest_helper.setup(
33+
file=__file__,
34+
globals_for_file=globals(),
35+
test_method="agent_engines.sessions._update",
36+
)

0 commit comments

Comments
 (0)