|
| 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