test_production_config_with_openai_env

Macro test_production_config_with_openai_env 

Source
macro_rules! test_production_config_with_openai_env {
    ($api_key:expr, $base_url:expr, $test:expr) => { ... };
}
Expand description

Execute ProductionConfigService tests with OPENAI environment variables.

This macro is a convenience version of test_production_config_with_env!, specifically designed for testing OPENAI_API_KEY and OPENAI_BASE_URL environment variables.

§Arguments

  • $api_key - OPENAI_API_KEY value (Option<&str>)
  • $base_url - OPENAI_BASE_URL value (Option<&str>)
  • $test - Test closure that receives a ProductionConfigService reference

§Examples

use subx_cli::test_production_config_with_openai_env;

test_production_config_with_openai_env!(
    Some("sk-test-key"),
    Some("https://test.api.com/v1"),
    |service| {
        let config = service.get_config().unwrap();
        assert_eq!(config.ai.api_key, Some("sk-test-key".to_string()));
        assert_eq!(config.ai.base_url, "https://test.api.com/v1");
    }
);