mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-07-01 22:50:54 +00:00
runtime-rs: Fix test breakage
In #13147, for some reason a test block was added in the middle of code and the code was stale when merged, which meant that a second `mod test` section was added, breaking our tests. Merge the two to fix this. Signed-off-by: stevenhorsman <steven@uk.ibm.com>
This commit is contained in:
committed by
Fabiano Fidêncio
parent
1d854ad7af
commit
fb4600d66a
@@ -89,20 +89,6 @@ fn effective_log_level(enable_debug: bool, log_level: &str) -> &str {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::effective_log_level;
|
||||
|
||||
#[test]
|
||||
fn test_effective_log_level() {
|
||||
assert_eq!(effective_log_level(false, "info"), "info");
|
||||
assert_eq!(effective_log_level(false, "debug"), "debug");
|
||||
assert_eq!(effective_log_level(true, "info"), "debug");
|
||||
assert_eq!(effective_log_level(true, "trace"), "trace");
|
||||
assert_eq!(effective_log_level(true, "warn"), "warn");
|
||||
}
|
||||
}
|
||||
|
||||
struct RuntimeHandlerManagerInner {
|
||||
id: String,
|
||||
msg_sender: Sender<Message>,
|
||||
@@ -1036,4 +1022,13 @@ mod tests {
|
||||
.expect("an Action::Shutdown message must be sent to stop the daemon");
|
||||
assert!(matches!(msg.action, Action::Shutdown));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_effective_log_level() {
|
||||
assert_eq!(effective_log_level(false, "info"), "info");
|
||||
assert_eq!(effective_log_level(false, "debug"), "debug");
|
||||
assert_eq!(effective_log_level(true, "info"), "debug");
|
||||
assert_eq!(effective_log_level(true, "trace"), "trace");
|
||||
assert_eq!(effective_log_level(true, "warn"), "warn");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user