@@ -790,7 +790,7 @@ def test_create_agent_engine_config_lightweight(self, mock_prepare):
790
790
def test_create_agent_engine_config_full (self , mock_prepare ):
791
791
config = self .client .agent_engines ._create_config (
792
792
mode = "create" ,
793
- agent_engine = self .test_agent ,
793
+ agent = self .test_agent ,
794
794
staging_bucket = _TEST_STAGING_BUCKET ,
795
795
requirements = _TEST_AGENT_ENGINE_REQUIREMENTS ,
796
796
display_name = _TEST_AGENT_ENGINE_DISPLAY_NAME ,
@@ -839,7 +839,7 @@ def test_create_agent_engine_config_full(self, mock_prepare):
839
839
def test_update_agent_engine_config_full (self , mock_prepare ):
840
840
config = self .client .agent_engines ._create_config (
841
841
mode = "update" ,
842
- agent_engine = self .test_agent ,
842
+ agent = self .test_agent ,
843
843
staging_bucket = _TEST_STAGING_BUCKET ,
844
844
requirements = _TEST_AGENT_ENGINE_REQUIREMENTS ,
845
845
display_name = _TEST_AGENT_ENGINE_DISPLAY_NAME ,
@@ -939,7 +939,7 @@ def test_await_operation(self):
939
939
940
940
def test_register_api_methods (self ):
941
941
agent = self .client .agent_engines ._register_api_methods (
942
- agent = _genai_types .AgentEngine (
942
+ agent_engine = _genai_types .AgentEngine (
943
943
api_client = self .client .agent_engines ._api_client ,
944
944
api_resource = _genai_types .ReasoningEngine (
945
945
spec = _genai_types .ReasoningEngineSpec (
@@ -956,7 +956,9 @@ def test_register_api_methods(self):
956
956
957
957
@pytest .mark .usefixtures ("caplog" )
958
958
def test_invalid_requirement_warning (self , caplog ):
959
- _agent_engines_utils ._parse_constraints (["invalid requirement line" ])
959
+ _agent_engines_utils ._parse_constraints (
960
+ constraints = ["invalid requirement line" ],
961
+ )
960
962
assert "Failed to parse constraint" in caplog .text
961
963
962
964
def test_requirements_with_whl_files (self ):
@@ -965,7 +967,9 @@ def test_requirements_with_whl_files(self):
965
967
"/content/wxPython-4.2.3-cp39-cp39-macosx_12_0_x86_64.whl" ,
966
968
"https://wxpython.org/Phoenix/snapshot-builds/wxPython-4.2.2-cp38-cp38-macosx_12_0_x86_64.whl" ,
967
969
]
968
- result = _agent_engines_utils ._parse_constraints (whl_files )
970
+ result = _agent_engines_utils ._parse_constraints (
971
+ constraints = whl_files ,
972
+ )
969
973
assert result == {
970
974
"wxPython-4.2.2-cp38-cp38-macosx_12_0_x86_64.whl" : None ,
971
975
"wxPython-4.2.3-cp39-cp39-macosx_12_0_x86_64.whl" : None ,
@@ -975,7 +979,10 @@ def test_requirements_with_whl_files(self):
975
979
def test_compare_requirements_with_required_packages (self ):
976
980
requirements = {"requests" : "2.0.0" }
977
981
constraints = ["requests==1.0.0" ]
978
- result = _agent_engines_utils ._compare_requirements (requirements , constraints )
982
+ result = _agent_engines_utils ._compare_requirements (
983
+ requirements = requirements ,
984
+ constraints = constraints ,
985
+ )
979
986
assert result == {
980
987
"actions" : {"append" : set ()},
981
988
"warnings" : {
@@ -989,7 +996,7 @@ def test_scan_simple_object(self):
989
996
"""Test scanning an object importing a known third-party package."""
990
997
fake_obj = _create_fake_object_with_module ("requests" )
991
998
requirements = _agent_engines_utils ._scan_requirements (
992
- fake_obj ,
999
+ obj = fake_obj ,
993
1000
package_distributions = _TEST_PACKAGE_DISTRIBUTIONS ,
994
1001
)
995
1002
assert requirements == {
@@ -1003,7 +1010,7 @@ def test_scan_object_with_stdlib_module(self):
1003
1010
"""Test that stdlib modules are ignored by default."""
1004
1011
fake_obj_stdlib = _create_fake_object_with_module ("json" )
1005
1012
requirements = _agent_engines_utils ._scan_requirements (
1006
- fake_obj_stdlib ,
1013
+ obj = fake_obj_stdlib ,
1007
1014
package_distributions = _TEST_PACKAGE_DISTRIBUTIONS ,
1008
1015
)
1009
1016
# Requirements should not contain 'json',
@@ -1024,7 +1031,7 @@ def test_scan_with_default_ignore_modules(self, monkeypatch):
1024
1031
set (original_base ) | {"requests" },
1025
1032
)
1026
1033
requirements = _agent_engines_utils ._scan_requirements (
1027
- fake_obj ,
1034
+ obj = fake_obj ,
1028
1035
package_distributions = _TEST_PACKAGE_DISTRIBUTIONS ,
1029
1036
)
1030
1037
# Requirements should not contain 'requests',
@@ -1039,7 +1046,7 @@ def test_scan_with_explicit_ignore_modules(self):
1039
1046
"""Test explicitly ignoring a module."""
1040
1047
fake_obj = _create_fake_object_with_module ("requests" )
1041
1048
requirements = _agent_engines_utils ._scan_requirements (
1042
- fake_obj ,
1049
+ obj = fake_obj ,
1043
1050
ignore_modules = ["requests" ],
1044
1051
package_distributions = _TEST_PACKAGE_DISTRIBUTIONS ,
1045
1052
)
@@ -1152,7 +1159,7 @@ def test_create_agent_engine(self, mock_await_operation, mock_prepare, caplog):
1152
1159
) as request_mock :
1153
1160
request_mock .return_value = genai_types .HttpResponse (body = "" )
1154
1161
self .client .agent_engines .create (
1155
- agent_engine = self .test_agent ,
1162
+ agent = self .test_agent ,
1156
1163
config = _genai_types .AgentEngineConfig (
1157
1164
display_name = _TEST_AGENT_ENGINE_DISPLAY_NAME ,
1158
1165
description = _TEST_AGENT_ENGINE_DESCRIPTION ,
@@ -1263,7 +1270,7 @@ def test_create_agent_engine_with_env_vars_dict(
1263
1270
) as request_mock :
1264
1271
request_mock .return_value = genai_types .HttpResponse (body = "" )
1265
1272
self .client .agent_engines .create (
1266
- agent_engine = self .test_agent ,
1273
+ agent = self .test_agent ,
1267
1274
config = _genai_types .AgentEngineConfig (
1268
1275
display_name = _TEST_AGENT_ENGINE_DISPLAY_NAME ,
1269
1276
requirements = _TEST_AGENT_ENGINE_REQUIREMENTS ,
@@ -1274,7 +1281,7 @@ def test_create_agent_engine_with_env_vars_dict(
1274
1281
)
1275
1282
mock_create_config .assert_called_with (
1276
1283
mode = "create" ,
1277
- agent_engine = self .test_agent ,
1284
+ agent = self .test_agent ,
1278
1285
staging_bucket = _TEST_STAGING_BUCKET ,
1279
1286
requirements = _TEST_AGENT_ENGINE_REQUIREMENTS ,
1280
1287
display_name = _TEST_AGENT_ENGINE_DISPLAY_NAME ,
@@ -1327,7 +1334,7 @@ def test_update_agent_engine_requirements(
1327
1334
request_mock .return_value = genai_types .HttpResponse (body = "" )
1328
1335
self .client .agent_engines .update (
1329
1336
name = _TEST_AGENT_ENGINE_RESOURCE_NAME ,
1330
- agent_engine = self .test_agent ,
1337
+ agent = self .test_agent ,
1331
1338
config = _genai_types .AgentEngineConfig (
1332
1339
staging_bucket = _TEST_STAGING_BUCKET ,
1333
1340
requirements = _TEST_AGENT_ENGINE_REQUIREMENTS ,
@@ -1383,7 +1390,7 @@ def test_update_agent_engine_extra_packages(
1383
1390
request_mock .return_value = genai_types .HttpResponse (body = "" )
1384
1391
self .client .agent_engines .update (
1385
1392
name = _TEST_AGENT_ENGINE_RESOURCE_NAME ,
1386
- agent_engine = self .test_agent ,
1393
+ agent = self .test_agent ,
1387
1394
config = _genai_types .AgentEngineConfig (
1388
1395
staging_bucket = _TEST_STAGING_BUCKET ,
1389
1396
requirements = _TEST_AGENT_ENGINE_REQUIREMENTS ,
@@ -1437,7 +1444,7 @@ def test_update_agent_engine_env_vars(
1437
1444
request_mock .return_value = genai_types .HttpResponse (body = "" )
1438
1445
self .client .agent_engines .update (
1439
1446
name = _TEST_AGENT_ENGINE_RESOURCE_NAME ,
1440
- agent_engine = self .test_agent ,
1447
+ agent = self .test_agent ,
1441
1448
config = _genai_types .AgentEngineConfig (
1442
1449
staging_bucket = _TEST_STAGING_BUCKET ,
1443
1450
requirements = _TEST_AGENT_ENGINE_REQUIREMENTS ,
@@ -1570,7 +1577,7 @@ def test_query_agent_engine(self):
1570
1577
) as request_mock :
1571
1578
request_mock .return_value = genai_types .HttpResponse (body = "" )
1572
1579
agent = self .client .agent_engines ._register_api_methods (
1573
- agent = _genai_types .AgentEngine (
1580
+ agent_engine = _genai_types .AgentEngine (
1574
1581
api_client = self .client .agent_engines ,
1575
1582
api_resource = _genai_types .ReasoningEngine (
1576
1583
name = _TEST_AGENT_ENGINE_RESOURCE_NAME ,
@@ -1596,7 +1603,7 @@ def test_query_agent_engine(self):
1596
1603
1597
1604
def test_query_agent_engine_async (self ):
1598
1605
agent = self .client .agent_engines ._register_api_methods (
1599
- agent = _genai_types .AgentEngine (
1606
+ agent_engine = _genai_types .AgentEngine (
1600
1607
api_async_client = agent_engines .AsyncAgentEngines (
1601
1608
api_client_ = self .client .agent_engines ._api_client
1602
1609
),
@@ -1631,7 +1638,7 @@ def test_query_agent_engine_stream(self):
1631
1638
self .client .agent_engines ._api_client , "request_streamed"
1632
1639
) as request_mock :
1633
1640
agent = self .client .agent_engines ._register_api_methods (
1634
- agent = _genai_types .AgentEngine (
1641
+ agent_engine = _genai_types .AgentEngine (
1635
1642
api_client = self .client .agent_engines ,
1636
1643
api_resource = _genai_types .ReasoningEngine (
1637
1644
name = _TEST_AGENT_ENGINE_RESOURCE_NAME ,
@@ -1664,7 +1671,7 @@ async def mock_async_generator():
1664
1671
) as request_mock :
1665
1672
request_mock .return_value = mock_async_generator ()
1666
1673
agent = self .client .agent_engines ._register_api_methods (
1667
- agent = _genai_types .AgentEngine (
1674
+ agent_engine = _genai_types .AgentEngine (
1668
1675
api_client = self .client .agent_engines ,
1669
1676
api_resource = _genai_types .ReasoningEngine (
1670
1677
name = _TEST_AGENT_ENGINE_RESOURCE_NAME ,
0 commit comments