Skip to content

Commit

Permalink
add test for get_boolean_from_metadata (#1121)
Browse files Browse the repository at this point in the history
Signed-off-by: Marijn Valk <[email protected]>

# Description
Adds a test for `get_boolean_from_metadata` from the `DeltaConfig`

# Related Issue(s)
<!---
For example:

- closes #106
--->

# Documentation

<!---
Share links to useful documentation
--->

Signed-off-by: Marijn Valk <[email protected]>
  • Loading branch information
marijncv authored Feb 5, 2023
1 parent 44338c1 commit 2c66b19
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions rust/src/delta_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,31 @@ mod tests {
)
}

#[test]
fn get_boolean_from_metadata_test() {
let mut md = dummy_metadata();

// default value is true
assert_eq!(
ENABLE_EXPIRED_LOG_CLEANUP
.get_boolean_from_metadata(&md)
.unwrap(),
true,
);

// change to false
md.configuration.insert(
ENABLE_EXPIRED_LOG_CLEANUP.key.to_string(),
Some("false".to_string()),
);
assert_eq!(
ENABLE_EXPIRED_LOG_CLEANUP
.get_boolean_from_metadata(&md)
.unwrap(),
false,
);
}

#[test]
fn parse_interval_test() {
assert_eq!(
Expand Down

0 comments on commit 2c66b19

Please sign in to comment.