POMDPPlanners.tests.test_configs package
Submodules
POMDPPlanners.tests.test_configs.test_environment_configs module
Test script to verify all environment configurations work correctly.
This test module validates that all environment configurations in the experiments directory can be instantiated and provide valid POMDP environments and beliefs.
- class POMDPPlanners.tests.test_configs.test_environment_configs.TestEnvironmentConfigs[source]
Bases:
objectTest class for environment configuration API.
- test_all_configs_have_consistent_interface()[source]
Test that all configuration methods return consistent types.
- test_config_api_initialization()[source]
Test EnvironmentConfigsAPI initialization with different parameters.
- test_continuous_light_dark_continuous_actions_config()[source]
Test ContinuousLightDarkPOMDP configuration creation.
- test_continuous_light_dark_discrete_actions_config()[source]
Test ContinuousLightDarkPOMDPDiscreteActions configuration creation.
- test_get_compatible_environments_continuous_continuous()[source]
Test get_compatible_environments with continuous action and observation spaces.
Purpose: Validates filtering for fully continuous policies
Given: A PolicySpaceInfo with continuous action and observation spaces When: get_compatible_environments is called Then: All returned environments have compatible space types
Test type: unit
- test_get_compatible_environments_discrete_continuous()[source]
Test get_compatible_environments with discrete actions and continuous observations.
Purpose: Validates filtering for policies with discrete actions and continuous observations
Given: A PolicySpaceInfo with discrete action and continuous observation spaces When: get_compatible_environments is called Then: All returned environments have compatible space types
Test type: unit
- test_get_compatible_environments_discrete_discrete()[source]
Test get_compatible_environments with discrete action and observation spaces.
Purpose: Validates that get_compatible_environments correctly filters environments
Given: A PolicySpaceInfo with discrete action and observation spaces When: get_compatible_environments is called with this policy space info Then: All returned environments have compatible space types
Test type: unit
- test_get_compatible_environments_empty_result()[source]
Test get_compatible_environments when no environments are compatible.
Purpose: Validates behavior when policy is incompatible with all environments
Given: A PolicySpaceInfo that might not match any environments When: get_compatible_environments is called Then: Returns an empty list without errors
Test type: unit
- test_get_compatible_environments_returns_proper_beliefs()[source]
Test that get_compatible_environments returns properly initialized beliefs.
Purpose: Validates that beliefs returned have correct particle counts
Given: A PolicySpaceInfo and specified n_particles parameter When: get_compatible_environments is called with n_particles=15 Then: All returned beliefs have exactly 15 particles
Test type: unit
- test_get_compatible_environments_verifies_compatibility_logic()[source]
Test that compatibility logic matches Policy._verify_environment_compatibility.
Purpose: Validates that the compatibility logic is consistent with Policy class
Given: A discrete-only policy space info When: get_compatible_environments is called Then: No continuous-only action space environments are returned
Test type: unit
- test_risk_averse_config_api_initialization()[source]
Test RiskAverseEnvironmentConfigsAPI initialization with different parameters.
- test_risk_averse_light_dark_continuous_actions_config()[source]
Test RiskAverseEnvironmentConfigsAPI light dark continuous actions configuration creation.
- test_risk_averse_light_dark_discrete_actions_config()[source]
Test RiskAverseEnvironmentConfigsAPI light dark discrete actions configuration creation.
- test_risk_averse_push_pomdp_config()[source]
Test RiskAverseEnvironmentConfigsAPI push POMDP configuration creation.