Skip to content

Commit

Permalink
Merge pull request #39 from jhkrug/fix-settings
Browse files Browse the repository at this point in the history
Changes so that the tutorial examples in writing policies with rust work correctly
  • Loading branch information
viccuad authored Oct 30, 2023
2 parents e37595c + c6a1b4d commit b660fa9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ mod tests {
use super::*;

use kubewarden_policy_sdk::test::Testcase;
use std::collections::HashSet;

#[test]
fn accept_pod_with_valid_name() -> Result<(), ()> {
Expand All @@ -77,7 +78,7 @@ mod tests {
name: String::from("Valid name"),
fixture_file: String::from(request_file),
expected_validation_result: true,
settings: Settings {},
settings: Settings {invalid_names: HashSet::from(["invalid name".to_owned()])},
};

let res = tc.eval(validate).unwrap();
Expand All @@ -97,7 +98,7 @@ mod tests {
name: String::from("Bad name"),
fixture_file: String::from(request_file),
expected_validation_result: false,
settings: Settings {},
settings: Settings {invalid_names: HashSet::from(["invalid name".to_owned()])},
};

let res = tc.eval(validate).unwrap();
Expand All @@ -117,7 +118,7 @@ mod tests {
name: String::from("Ingress creation"),
fixture_file: String::from(request_file),
expected_validation_result: true,
settings: Settings {},
settings: Settings {invalid_names: HashSet::from(["invalid name".to_owned()])},
};

let res = tc.eval(validate).unwrap();
Expand Down

0 comments on commit b660fa9

Please sign in to comment.