Skip to content

Commit

Permalink
Improve test and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Serock3 committed Jan 14, 2025
1 parent 6109038 commit c0aea0e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions test/test-manager/src/config/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ mod locations {
pub struct TestLocationList(pub Vec<TestLocation>);

impl TestLocationList {
// TODO: Consider if we should handle the case of an empty list by returning vec!["any"]
/// Look up a test (by name) and see if there are any locations
/// that we should use.
pub fn lookup(&self, test: &str) -> Option<&Vec<String>> {
self.0
.iter()
Expand Down Expand Up @@ -173,12 +170,17 @@ mod tests {
"vms": {},
"mullvad_host": "mullvad.net",
"test_locations": [
{ "daita": [ "se-got-wg-001", "se-got-wg-002" ] },
{ "*daita": [ "se-got-wg-001", "se-got-wg-002" ] },
{ "*": [ "se" ] }
]
}"#;

let config: Config = serde_json::from_str(config).unwrap();
assert!(config
.test_locations
.lookup("test_daita")
.unwrap()
.contains(&"se-got-wg-002".to_string()));
assert!(!config.test_locations.0.is_empty());
}
}

0 comments on commit c0aea0e

Please sign in to comment.