Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
cataggar committed Sep 17, 2023
1 parent 7d8f2ca commit 74e9588
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions sdk/identity/src/token_credentials/azure_cli_credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ mod az_cli_date_format {
}

/// Assumes the local offset. Default to UTC if unable to get local offset.
fn assume_local(date: &PrimitiveDateTime) -> OffsetDateTime {
pub fn assume_local(date: &PrimitiveDateTime) -> OffsetDateTime {
date.assume_offset(UtcOffset::current_local_offset().unwrap_or(UtcOffset::UTC))
}

Expand Down Expand Up @@ -135,15 +135,14 @@ impl TokenCredential for AzureCliCredential {
#[cfg(test)]
mod tests {
use super::*;
use azure_core::date;
use time::macros::datetime;

#[test]
fn can_parse_expires_on() -> azure_core::Result<()> {
let expires_on = "2022-07-30 12:12:53.919110";
assert_eq!(
az_cli_date_format::parse(expires_on)?,
date::assume_local(&datetime!(2022-07-30 12:12:53.919110))
az_cli_date_format::assume_local(&datetime!(2022-07-30 12:12:53.919110))
);
Ok(())
}
Expand Down

0 comments on commit 74e9588

Please sign in to comment.