conf: add IMAP config in config parse test

This commit is contained in:
Manos Pitsidianakis 2022-06-04 17:56:54 +03:00
parent e6d6e1f588
commit 0f6f3e30c6

View File

@ -1176,6 +1176,18 @@ format = "mbox"
index_style = "Compact"
identity="username@hostname.local"
[composing]
send_mail = '/bin/false'
"#;
const IMAP_CONFIG: &str = r#"
[accounts.imap]
root_mailbox = "INBOX"
format = "imap"
identity="username@example.com"
server_username = "null"
server_hostname = "example.com"
server_password_command = "/bin/false"
[composing]
send_mail = '/bin/false'
"#;
@ -1227,6 +1239,12 @@ send_mail = '/bin/false'
"Unrecognised configuration values: {\"index_style\": \"Compact\"}"
);
/* Test IMAP config */
let new_file = ConfigFile::new(IMAP_CONFIG).unwrap();
FileSettings::validate(new_file.path.clone(), false, true)
.expect("could not parse IMAP config");
/* Test sample config */
let example_config = EXAMPLE_CONFIG.replace("\n#", "\n");