|
26 | 26 | import pytest |
27 | 27 |
|
28 | 28 | from ... import Client |
| 29 | +from ... import environments |
| 30 | +from ... import interactions |
29 | 31 | from ..._gaos.google_genai import ( |
30 | 32 | AsyncGeminiNextGenEnvironmentFiles, |
31 | 33 | GeminiNextGenEnvironmentFiles, |
@@ -706,3 +708,28 @@ def test_python_environments_types_and_models(): |
706 | 708 | from_environment="environments/env_abc_1234", |
707 | 709 | ) |
708 | 710 | assert create_req.from_environment == "environments/env_abc_1234" |
| 711 | + |
| 712 | + |
| 713 | +def test_python_environments_dedicated_module_and_from_environment(): |
| 714 | + """Tests dedicated environments module and from_environment creation.""" |
| 715 | + assert hasattr(environments, "CreateEnvironmentRequest") |
| 716 | + assert hasattr(environments, "Environment") |
| 717 | + assert hasattr(environments, "EnvironmentListResponse") |
| 718 | + assert hasattr(environments, "EnvironmentFile") |
| 719 | + assert hasattr(environments, "GetEnvironmentFilesResponse") |
| 720 | + assert hasattr(environments, "EnvironmentStatus") |
| 721 | + assert hasattr(environments, "EnvironmentListParams") |
| 722 | + assert hasattr(environments, "EnvironmentDeleteResponse") |
| 723 | + |
| 724 | + # Test backward-compatible re-exports in interactions module |
| 725 | + assert hasattr(interactions, "Environment") |
| 726 | + assert hasattr(interactions, "CreateEnvironmentRequest") |
| 727 | + assert hasattr(interactions, "EnvironmentFile") |
| 728 | + |
| 729 | + req = environments.CreateEnvironmentRequest( |
| 730 | + from_environment="environments/env_abc_1234", |
| 731 | + ) |
| 732 | + assert req.from_environment == "environments/env_abc_1234" |
| 733 | + |
| 734 | + req_dict = req.model_dump(exclude_unset=True, by_alias=True) |
| 735 | + assert req_dict == {"from_environment": "environments/env_abc_1234"} |
0 commit comments