weather_man 0.2.10

A feature-rich Rust-based CLI for weather forecasting with cyberpunk-themed animations
Documentation
// Note: Using mockito with tokio can cause runtime conflicts in tests
use weather_man::modules::forecaster::WeatherForecaster;
use weather_man::modules::types::WeatherConfig;

// This test is disabled due to tokio runtime conflicts
// To be fixed in a future update
#[test]
#[ignore]
fn test_location_service_get_location_by_name() {
    // This test has been disabled due to tokio runtime conflicts
    // It would test the LocationService's ability to get location data by name
    // using mocked HTTP responses from the Nominatim API
}

// This test is disabled due to tokio runtime conflicts
// To be fixed in a future update
#[test]
#[ignore]
fn test_forecast_api() {
    // This test has been disabled due to tokio runtime conflicts
    // It would test the WeatherForecaster's ability to retrieve and parse
    // weather data using mocked HTTP responses from the Open-Meteo API
}

#[test]
fn test_weather_condition_mapping() {
    // Create a forecaster to access the mapping methods
    let config = WeatherConfig::default();
    let forecaster = WeatherForecaster::new(config);

    // Test WMO code to condition mappings
    let clear = forecaster.wmo_code_to_condition(0);
    assert_eq!(clear, weather_man::modules::types::WeatherCondition::Clear);

    let clouds = forecaster.wmo_code_to_condition(2);
    assert_eq!(
        clouds,
        weather_man::modules::types::WeatherCondition::Clouds
    );

    let rain = forecaster.wmo_code_to_condition(61);
    assert_eq!(rain, weather_man::modules::types::WeatherCondition::Rain);

    let snow = forecaster.wmo_code_to_condition(71);
    assert_eq!(snow, weather_man::modules::types::WeatherCondition::Snow);

    let thunder = forecaster.wmo_code_to_condition(95);
    assert_eq!(
        thunder,
        weather_man::modules::types::WeatherCondition::Thunderstorm
    );

    // Test weather description generation
    let desc_clear = forecaster.get_weather_description_from_wmo(0, true);
    assert_eq!(desc_clear.main, "Clear");
    assert_eq!(desc_clear.description, "Clear sky");
    assert_eq!(desc_clear.icon, "01d");

    let desc_clouds = forecaster.get_weather_description_from_wmo(3, true);
    assert_eq!(desc_clouds.main, "Clouds");
    assert_eq!(desc_clouds.description, "Overcast");

    // Test day/night icon differences
    let desc_clear_night = forecaster.get_weather_description_from_wmo(0, false);
    assert_eq!(desc_clear_night.icon, "01n");
}