test: Add test for EncryptedTokenStorage::new (#17)

This commit is contained in:
Justin Poehnelt
2026-03-03 16:03:10 -07:00
committed by GitHub
parent b0d0b95d07
commit c11d3c452d
2 changed files with 22 additions and 0 deletions
@@ -0,0 +1,5 @@
---
"@googleworkspace/cli": patch
---
Added test coverage for `EncryptedTokenStorage::new` initialization.
+17
View File
@@ -132,3 +132,20 @@ impl TokenStorage for EncryptedTokenStorage {
None
}
}
#[cfg(test)]
mod tests {
use super::*;
use std::path::PathBuf;
#[tokio::test]
async fn test_encrypted_token_storage_new() {
let path = PathBuf::from("/fake/path/to/token.json");
let storage = EncryptedTokenStorage::new(path.clone());
assert_eq!(storage.file_path, path);
let cache_lock = storage.cache.lock().await;
assert!(cache_lock.is_none());
}
}