diff --git a/src/ingest.rs b/src/ingest.rs index 42b0273..355b859 100644 --- a/src/ingest.rs +++ b/src/ingest.rs @@ -442,7 +442,7 @@ mod tests { maps.insert( DIM_MONTH.to_string(), HashMap::from([ - ("Toskur".to_string(), "Januar 2015".to_string()), + ("2015M01".to_string(), "Januar 2015".to_string()), ("2015M02".to_string(), "Februar 2015".to_string()), ]), ); @@ -466,7 +466,7 @@ mod tests { #[test] fn test_build_query_uses_correct_dimension_codes() { let months = vec!["2015M01".to_string(), "2015M02".to_string()]; - let query = build_query(&months); + let query = build_query(&months).unwrap(); assert_eq!(query.response.format, "json-stat2"); assert_eq!(query.query.len(), 8); @@ -505,6 +505,12 @@ mod tests { ); } + #[test] + fn test_build_query_returns_error_on_empty() { + let result = build_query(&[]); + assert!(result.is_err()); + } + #[test] fn test_decode_key_indices_basic() { let key_sizes = vec![2, 2, 2]; @@ -676,12 +682,6 @@ mod tests { assert!(months.is_empty()); } - #[test] - #[should_panic(expected = "requires at least one month")] - fn test_build_query_empty_panics() { - let _ = build_query(&[]); - } - #[test] fn test_variable_meta_lookup_map() { let var = VariableMeta {