notify: don't make tests require pve-context

Tests now have their own context, so requiring pve-context is not
necessary any more.

Signed-off-by: Lukas Wagner <l.wagner@proxmox.com>
Tested-by: Folke Gleumes <f.gleumes@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Lukas Wagner 2024-04-19 16:17:07 +02:00 committed by Thomas Lamprecht
parent d61e3fc759
commit 50d80328e5
4 changed files with 15 additions and 15 deletions

View File

@ -165,7 +165,7 @@ fn remove_private_config_entry(config: &mut Config, name: &str) -> Result<(), Ht
Ok(())
}
#[cfg(all(feature = "pve-context", test))]
#[cfg(test)]
mod tests {
use super::*;
use crate::api::test_helpers::empty_config;

View File

@ -148,7 +148,7 @@ pub fn delete_matcher(config: &mut Config, name: &str) -> Result<(), HttpError>
Ok(())
}
#[cfg(all(test, feature = "sendmail", feature = "pve-context"))]
#[cfg(all(test, feature = "sendmail"))]
mod tests {
use super::*;
use crate::matcher::MatchModeOperator;

View File

@ -151,7 +151,7 @@ pub fn delete_endpoint(config: &mut Config, name: &str) -> Result<(), HttpError>
Ok(())
}
#[cfg(all(feature = "pve-context", test))]
#[cfg(test)]
pub mod tests {
use super::*;
use crate::api::test_helpers::*;

View File

@ -200,7 +200,7 @@ pub fn delete_endpoint(config: &mut Config, name: &str) -> Result<(), HttpError>
Ok(())
}
#[cfg(all(feature = "pve-context", test))]
#[cfg(test)]
pub mod tests {
use super::*;
use crate::api::test_helpers::*;
@ -348,15 +348,15 @@ pub mod tests {
Ok(())
}
// #[test]
// fn test_delete() -> Result<(), HttpError> {
// let mut config = empty_config();
// add_smtp_endpoint_for_test(&mut config, "smtp-endpoint")?;
//
// delete_endpoint(&mut config, "smtp-endpoint")?;
// assert!(delete_endpoint(&mut config, "smtp-endpoint").is_err());
// assert_eq!(get_endpoints(&config)?.len(), 0);
//
// Ok(())
// }
#[test]
fn test_delete() -> Result<(), HttpError> {
let mut config = empty_config();
add_smtp_endpoint_for_test(&mut config, "smtp-endpoint")?;
delete_endpoint(&mut config, "smtp-endpoint")?;
assert!(delete_endpoint(&mut config, "smtp-endpoint").is_err());
assert_eq!(get_endpoints(&config)?.len(), 0);
Ok(())
}
}