This commit is contained in:
mdecimus
2025-03-23 16:23:18 +01:00
parent a8bdf3949b
commit c0fdee6843
23 changed files with 78 additions and 55 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "tests"
version = "0.11.5"
version = "0.11.7"
edition = "2024"
resolver = "2"

View File

@@ -5,8 +5,8 @@
*/
use directory::{
backend::{internal::manage::ManageDirectory, RcptType},
QueryBy, Type, ROLE_USER,
QueryBy, ROLE_USER, Type,
backend::{RcptType, internal::manage::ManageDirectory},
};
use mail_send::Credentials;
@@ -14,7 +14,7 @@ use mail_send::Credentials;
use store::{InMemoryStore, Store};
use crate::directory::{
map_account_id, map_account_ids, DirectoryTest, IntoTestPrincipal, TestPrincipal,
DirectoryTest, IntoTestPrincipal, TestPrincipal, map_account_id, map_account_ids,
};
use super::DirectoryStore;
@@ -39,7 +39,7 @@ async fn sql_directory() {
let store = DirectoryStore {
store: config.stores.stores.remove(directory_id).unwrap(),
};
let base_store = config.stores.stores.get(directory_id).unwrap();
let base_store = &store.store;
let core = config.server;
// Create tables
@@ -193,17 +193,19 @@ async fn sql_directory() {
..Default::default()
}
);
assert!(handle
.query(
QueryBy::Credentials(&Credentials::Plain {
username: "bill".to_string(),
secret: "invalid".to_string()
}),
true
)
.await
.unwrap()
.is_none());
assert!(
handle
.query(
QueryBy::Credentials(&Credentials::Plain {
username: "bill".to_string(),
secret: "invalid".to_string()
}),
true
)
.await
.unwrap()
.is_none()
);
// Get user by name
assert_eq!(