From 5f694621f7480eed3074b3a1e85f259d4a907df9 Mon Sep 17 00:00:00 2001 From: Nathan Thorpe Date: Wed, 19 Nov 2025 19:41:24 -0800 Subject: [PATCH 1/3] add test for api client and model functionality --- tests/test_client.py | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/tests/test_client.py b/tests/test_client.py index a5c723c..6ac5998 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1,9 +1,40 @@ import unittest +from http import HTTPStatus +from unittest.mock import Mock -from cirro_api_client import CirroApiClient, TokenAuth +from cirro_api_client.v1.models import User + + +def _generate_mock_client(response_data: dict): + mock_client = Mock() + httpx_client = Mock() + mock_client.get_httpx_client.return_value = httpx_client + mock_request = Mock() + httpx_client.request.return_value = mock_request + status_code = HTTPStatus(200) + mock_request.status_code = status_code + mock_request.json.return_value = response_data + return mock_client class TestClient(unittest.TestCase): def test_client_set_up(self): + from cirro_api_client import CirroApiClient, TokenAuth client = CirroApiClient(auth_method=TokenAuth(token=""), base_url="https://api.cirro.bio") self.assertIsNotNone(client) + + def test_import_models(self): + from cirro_api_client.v1.models import InviteUserRequest + req = InviteUserRequest(name="Test User", organization="test", email="test") + self.assertEqual(req.name, "Test User") + self.assertIn('name', req.to_dict()) + self.assertEqual(len(req.additional_properties.keys()), 0) + + def test_import_api_methods(self): + from cirro_api_client.v1.api.users import list_users + mock_client = _generate_mock_client({'data': [Mock()], 'nextToken': None}) + + response = list_users.sync(client=mock_client, limit=1) + self.assertIsNotNone(response) + self.assertEqual(len(response.data), 1) + self.assertIsInstance(response.data[0], User) From 90ed42a9698476b50751de8ea2a055e6b791e364 Mon Sep 17 00:00:00 2001 From: Nathan Thorpe Date: Wed, 19 Nov 2025 19:41:49 -0800 Subject: [PATCH 2/3] bump version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 377bd46..9874453 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "cirro_api_client" -version = "1.2.0" +version = "1.2.1" description = "A client library for accessing Cirro" authors = ["Cirro "] license = "MIT" From 8112849c53d127774486f85e035e31f72d0c5fcc Mon Sep 17 00:00:00 2001 From: Nathan Thorpe Date: Wed, 19 Nov 2025 19:42:02 -0800 Subject: [PATCH 3/3] commit --- ...ce_compute_config_environment_variables.py | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 cirro_api_client/v1/models/workspace_compute_config_environment_variables.py diff --git a/cirro_api_client/v1/models/workspace_compute_config_environment_variables.py b/cirro_api_client/v1/models/workspace_compute_config_environment_variables.py new file mode 100644 index 0000000..e183018 --- /dev/null +++ b/cirro_api_client/v1/models/workspace_compute_config_environment_variables.py @@ -0,0 +1,37 @@ +from typing import Any, Dict, List, Type, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="WorkspaceComputeConfigEnvironmentVariables") + + +@_attrs_define +class WorkspaceComputeConfigEnvironmentVariables: + """Map of environment variables injected into the container at runtime. Keys must be non-blank. + + Example: + {'ENV_MODE': 'production', 'LOG_LEVEL': 'debug'} + + """ + + additional_properties: Dict[str, str] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> Dict[str, Any]: + field_dict: Dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + + return field_dict + + @classmethod + def from_dict(cls: Type[T], src_dict: Dict[str, Any]) -> T: + d = src_dict.copy() + workspace_compute_config_environment_variables = cls() + + workspace_compute_config_environment_variables.additional_properties = d + return workspace_compute_config_environment_variables + + @property + def additional_keys(self) -> List[str]: + return list(self.additional_properties.keys())