mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Fix a unit test that had aged beyond the code it was testing and was no longer valid.
This commit is contained in:
parent
3c6cae7959
commit
ea6d0b6006
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user