refactor: adapters configured from config crate
This commit is contained in:
@@ -43,3 +43,15 @@ fn avif_extension() {
|
||||
fn webp_extension() {
|
||||
assert_eq!(Format::Webp.extension(), ".webp");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn from_config_follows_section() {
|
||||
let disabled = ::config::ImageConversionConfig::default();
|
||||
assert!(ConversionConfig::from_config(&disabled).unwrap().is_none());
|
||||
let enabled = ::config::ImageConversionConfig {
|
||||
enabled: true,
|
||||
format: Some("webp".into()),
|
||||
};
|
||||
let cfg = ConversionConfig::from_config(&enabled).unwrap().unwrap();
|
||||
assert_eq!(cfg.format, Format::Webp);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user