INNER CODE UNIT · Rust

from_env_reads_the_request_timeout_when_set

pbeets/rithmic-rs · src/config.rs:872

    fn from_env_reads_the_request_timeout_when_set() {
        let mut vars = demo_env_vars();
        vars.push((REQUEST_TIMEOUT_VAR, Some("5")));

        temp_env::with_vars(vars, || {
            let config = RithmicConfig::from_env(RithmicEnv::Demo).unwrap();

            assert_eq!(config.request_timeout, Duration::from_secs(5));
        });
    }

    #[test]
    fn from_env_defaults_the_request_timeout_when_unset() {
        let mut vars = demo_env_vars();
        vars.push((REQUEST_TIMEOUT_VAR, None));

        temp_env::with_vars(vars, || {
            let config = RithmicConfig::from_env(RithmicEnv::Demo).unwrap();

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…