Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Don't ever try to load account ID in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jyn514 committed Aug 13, 2021
1 parent a832b73 commit c3ad80e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/settings/toml/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -585,8 +585,13 @@ impl LazyAccountId {
}

/// Load the account ID, possibly prompting the user.
#[cfg_attr(test, allow(unreachable_code))]
pub(crate) fn load(&self) -> Result<&String> {
self.0.get_or_try_init(|| {
#[cfg(test)]
// don't try to fetch the accounts for this ID, since it's not valid.
return Ok("thisisanaccountid".to_string());

let user = GlobalUser::new()?;
match fetch_accounts(&user)?.as_slice() {
[] => unreachable!("auth token without account?"),
Expand Down

0 comments on commit c3ad80e

Please sign in to comment.