Use storage helpers in auth and OAuth keyring tests

This commit is contained in:
mikhail-oai
2026-03-19 20:05:09 -04:00
parent e0f0c0ff1a
commit 15563e1e9d
2 changed files with 4 additions and 5 deletions

View File

@@ -393,11 +393,7 @@ fn auto_auth_storage_load_prefers_keyring_value() -> anyhow::Result<()> {
Arc::new(mock_keyring.clone()),
);
let keyring_auth = auth_with_prefix("keyring");
seed_keyring_with_auth(
&mock_keyring,
|| compute_store_key(codex_home.path()),
&keyring_auth,
)?;
storage.keyring_storage.save(&keyring_auth)?;
let file_auth = auth_with_prefix("file");
storage.file_storage.save(&file_auth)?;

View File

@@ -948,6 +948,9 @@ mod tests {
let _env = TempCodexHome::new();
let store = KeyringStoreWithError::fail_delete(MockKeyringStore::default());
let tokens = sample_tokens();
let key = super::compute_store_key(&tokens.server_name, &tokens.url)?;
let value = serde_json::to_value(&tokens)?;
save_json_to_keyring(&store, KEYRING_SERVICE, &key, &value)?;
super::save_oauth_tokens_to_file(&tokens).unwrap();
let result = super::delete_oauth_tokens_from_keyring_and_file(