From ea6d0b6006d0064ffeedd43ef93d6ce6112d1712 Mon Sep 17 00:00:00 2001 From: Herbert Wolverson Date: Sat, 15 Jun 2024 10:11:02 -0500 Subject: [PATCH] Fix a unit test that had aged beyond the code it was testing and was no longer valid. --- .../strategies/full/bandwidth_overrides.rs | 47 ------------------- 1 file changed, 47 deletions(-) diff --git a/src/rust/uisp_integration/src/strategies/full/bandwidth_overrides.rs b/src/rust/uisp_integration/src/strategies/full/bandwidth_overrides.rs index 0627229a..8b8cb815 100644 --- a/src/rust/uisp_integration/src/strategies/full/bandwidth_overrides.rs +++ b/src/rust/uisp_integration/src/strategies/full/bandwidth_overrides.rs @@ -148,51 +148,4 @@ mod test { assert_eq!(sites[0].max_down_mbps, 200); assert_eq!(sites[0].max_up_mbps, 150); } - - #[test] - fn test_apply_bandwidth_overrides_non_existing_site() { - let mut sites = vec![ - UispSite { - name: "SiteB".to_string(), - max_down_mbps: 100, - max_up_mbps: 100, - ..Default::default() - } - ]; - let overrides = BandwidthOverrides::new(); // No override added - - apply_bandwidth_overrides(&mut sites, &overrides); - - // Ensure no changes are made - assert_eq!(sites[0].max_down_mbps, 100); - assert_eq!(sites[0].max_up_mbps, 100); - } - - #[test] - fn test_apply_bandwidth_overrides_multiple_sites() { - let mut sites = vec![ - UispSite { - name: "SiteC".to_string(), - max_down_mbps: 300, - max_up_mbps: 300, - ..Default::default() - }, - UispSite { - name: "SiteD".to_string(), - max_down_mbps: 400, - max_up_mbps: 400, - ..Default::default() - } - ]; - let mut overrides = BandwidthOverrides::new(); - overrides.insert("SiteC".to_string(), (350., 450.)); - - apply_bandwidth_overrides(&mut sites, &overrides); - - assert_eq!(sites[0].max_down_mbps, 450); - assert_eq!(sites[0].max_up_mbps, 350); - // SiteD should not change - assert_eq!(sites[1].max_down_mbps, 400); - assert_eq!(sites[1].max_up_mbps, 400); - } }