mirror of
https://github.com/openai/codex.git
synced 2026-04-24 06:35:50 +00:00
Use storage helpers in auth and OAuth keyring tests
This commit is contained in:
@@ -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)?;
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user