Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions client/tests/file_unlocked_keyring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ fn strong_key() -> Secret {

#[tokio::test]
async fn repeated_write() -> Result<(), Error> {
let path = PathBuf::from("../../tests/test.keyring");
let temp_dir = tempdir()?;
let path = temp_dir.path().join("test.keyring");

let secret = Secret::from(vec![1, 2]);
let keyring = UnlockedKeyring::load(&path, secret).await?;
Expand All @@ -26,7 +27,8 @@ async fn repeated_write() -> Result<(), Error> {

#[tokio::test]
async fn delete() -> Result<(), Error> {
let path = PathBuf::from("../../tests/test-delete.keyring");
let temp_dir = tempdir()?;
let path = temp_dir.path().join("test-delete.keyring");

let keyring = UnlockedKeyring::load(&path, strong_key()).await?;
let attributes: HashMap<&str, &str> = HashMap::default();
Expand All @@ -45,7 +47,8 @@ async fn delete() -> Result<(), Error> {

#[tokio::test]
async fn write_with_weak_key() -> Result<(), Error> {
let path = PathBuf::from("../../tests/write_with_weak_key.keyring");
let temp_dir = tempdir()?;
let path = temp_dir.path().join("write_with_weak_key.keyring");

let secret = Secret::from(vec![1, 2]);
let keyring = UnlockedKeyring::load(&path, secret).await?;
Expand All @@ -65,7 +68,8 @@ async fn write_with_weak_key() -> Result<(), Error> {

#[tokio::test]
async fn write_with_strong_key() -> Result<(), Error> {
let path = PathBuf::from("../../tests/write_with_strong_key.keyring");
let temp_dir = tempdir()?;
let path = temp_dir.path().join("write_with_strong_key.keyring");

let keyring = UnlockedKeyring::load(&path, strong_key()).await?;
let attributes: HashMap<&str, &str> = HashMap::default();
Expand All @@ -79,7 +83,8 @@ async fn write_with_strong_key() -> Result<(), Error> {

#[tokio::test]
async fn concurrent_writes() -> Result<(), Error> {
let path = PathBuf::from("../../tests/concurrent_writes.keyring");
let temp_dir = tempdir()?;
let path = temp_dir.path().join("concurrent_writes.keyring");

let keyring = Arc::new(UnlockedKeyring::load(&path, strong_key()).await?);

Expand Down
Loading