pinakes-core: update remaining modules and tests
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I9e0ff5ea33a5cf697473423e88f167ce6a6a6964
This commit is contained in:
parent
c8425a4c34
commit
3d9f8933d2
44 changed files with 1207 additions and 578 deletions
|
|
@ -121,7 +121,7 @@ async fn test_delete_user_sessions() {
|
|||
// Create multiple sessions for the same user
|
||||
for i in 0..3 {
|
||||
let session = SessionData {
|
||||
session_token: format!("token_{}", i),
|
||||
session_token: format!("token_{i}"),
|
||||
user_id: None,
|
||||
username: "testuser".to_string(),
|
||||
role: "viewer".to_string(),
|
||||
|
|
@ -152,7 +152,7 @@ async fn test_delete_user_sessions() {
|
|||
for i in 0..3 {
|
||||
assert!(
|
||||
storage
|
||||
.get_session(&format!("token_{}", i))
|
||||
.get_session(&format!("token_{i}"))
|
||||
.await
|
||||
.unwrap()
|
||||
.is_none()
|
||||
|
|
@ -217,7 +217,7 @@ async fn test_list_active_sessions() {
|
|||
// Create active sessions for different users
|
||||
for i in 0..3 {
|
||||
let session = SessionData {
|
||||
session_token: format!("user1_token_{}", i),
|
||||
session_token: format!("user1_token_{i}"),
|
||||
user_id: None,
|
||||
username: "user1".to_string(),
|
||||
role: "viewer".to_string(),
|
||||
|
|
@ -230,7 +230,7 @@ async fn test_list_active_sessions() {
|
|||
|
||||
for i in 0..2 {
|
||||
let session = SessionData {
|
||||
session_token: format!("user2_token_{}", i),
|
||||
session_token: format!("user2_token_{i}"),
|
||||
user_id: None,
|
||||
username: "user2".to_string(),
|
||||
role: "admin".to_string(),
|
||||
|
|
@ -279,9 +279,9 @@ async fn test_concurrent_session_operations() {
|
|||
let storage = storage.clone();
|
||||
let handle = tokio::spawn(async move {
|
||||
let session = SessionData {
|
||||
session_token: format!("concurrent_{}", i),
|
||||
session_token: format!("concurrent_{i}"),
|
||||
user_id: None,
|
||||
username: format!("user{}", i),
|
||||
username: format!("user{i}"),
|
||||
role: "viewer".to_string(),
|
||||
created_at: now,
|
||||
expires_at: now + chrono::Duration::hours(24),
|
||||
|
|
@ -301,7 +301,7 @@ async fn test_concurrent_session_operations() {
|
|||
for i in 0..10 {
|
||||
assert!(
|
||||
storage
|
||||
.get_session(&format!("concurrent_{}", i))
|
||||
.get_session(&format!("concurrent_{i}"))
|
||||
.await
|
||||
.unwrap()
|
||||
.is_some()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue