Skip to content

Commit c82dbc7

Browse files
test(boxsdkgen): add tests for enterpriseConfigurations manager (box/box-codegen#875) (#1166)
* chore: Update `.codegen.json` with commit hash of `codegen` and `openapi` spec [skip ci] * test: add tests for `enterpriseConfigurations` manager (box/box-codegen#875)
1 parent b6a05c5 commit c82dbc7

File tree

3 files changed

+63
-2
lines changed

3 files changed

+63
-2
lines changed

.codegen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ "engineHash": "e6b1577", "specHash": "1715587", "version": "4.0.0" }
1+
{ "engineHash": "8cdcb1b", "specHash": "1715587", "version": "4.0.0" }

docs/box_sdk_gen/enterprise_configurations.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@ This operation is performed by calling function `get_enterprise_configuration_by
1111
See the endpoint docs at
1212
[API Reference](https://developer.box.com/reference/v2025.0/get-enterprise-configurations-id/).
1313

14-
_Currently we don't have an example for calling `get_enterprise_configuration_by_id_v2025_r0` in integration tests_
14+
<!-- sample get_enterprise_configurations_id_v2025.0 -->
15+
16+
```python
17+
admin_client.enterprise_configurations.get_enterprise_configuration_by_id_v2025_r0(enterprise_id, ['user_settings', 'content_and_sharing', 'security', 'shield'])
18+
```
1519

1620
### Arguments
1721

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
from box_sdk_gen.internal.utils import to_string
2+
3+
from box_sdk_gen.client import BoxClient
4+
5+
from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_v2025_r0 import (
6+
EnterpriseConfigurationV2025R0,
7+
)
8+
9+
from box_sdk_gen.internal.utils import get_env_var
10+
11+
from test.box_sdk_gen.test.commons import get_default_client_with_user_subject
12+
13+
from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_user_settings_v2025_r0 import (
14+
EnterpriseConfigurationUserSettingsV2025R0,
15+
)
16+
17+
from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_content_and_sharing_v2025_r0 import (
18+
EnterpriseConfigurationContentAndSharingV2025R0,
19+
)
20+
21+
from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_security_v2025_r0 import (
22+
EnterpriseConfigurationSecurityV2025R0,
23+
)
24+
25+
from box_sdk_gen.schemas.v2025_r0.enterprise_configuration_shield_v2025_r0 import (
26+
EnterpriseConfigurationShieldV2025R0,
27+
)
28+
29+
admin_client: BoxClient = get_default_client_with_user_subject(get_env_var('USER_ID'))
30+
31+
32+
def testGetEnterpriseConfigurationById():
33+
enterprise_id: str = get_env_var('ENTERPRISE_ID')
34+
enterprise_configuration: EnterpriseConfigurationV2025R0 = (
35+
admin_client.enterprise_configurations.get_enterprise_configuration_by_id_v2025_r0(
36+
enterprise_id,
37+
['user_settings', 'content_and_sharing', 'security', 'shield'],
38+
)
39+
)
40+
assert to_string(enterprise_configuration.type) == 'enterprise_configuration'
41+
user_settings: EnterpriseConfigurationUserSettingsV2025R0 = (
42+
enterprise_configuration.user_settings
43+
)
44+
assert user_settings.is_enterprise_sso_required.value == False
45+
assert user_settings.new_user_default_language.value == 'English (US)'
46+
assert user_settings.new_user_default_storage_limit.value == -1
47+
content_and_sharing: EnterpriseConfigurationContentAndSharingV2025R0 = (
48+
enterprise_configuration.content_and_sharing
49+
)
50+
assert (
51+
content_and_sharing.collaboration_permissions.value.is_editor_role_enabled
52+
== True
53+
)
54+
security: EnterpriseConfigurationSecurityV2025R0 = enterprise_configuration.security
55+
assert security.is_managed_user_signup_enabled.value == False
56+
shield: EnterpriseConfigurationShieldV2025R0 = enterprise_configuration.shield
57+
assert len(shield.shield_rules) == 0

0 commit comments

Comments
 (0)