Replace chrono with time

This commit is contained in:
Sarah Bird
2022-03-11 19:39:11 -06:00
parent 4b414ca775
commit 2128772d88
5 changed files with 25 additions and 23 deletions

View File

@@ -334,7 +334,7 @@ async fn create_service_account_auth(server: &Server) -> DefaultAuthenticator {
#[tokio::test]
async fn test_service_account_success() {
use chrono::Utc;
use time::OffsetDateTime;
let _ = env_logger::try_init();
let server = Server::run();
let auth = create_service_account_auth(&server).await;
@@ -352,7 +352,7 @@ async fn test_service_account_success() {
.await
.expect("token failed");
assert!(tok.as_str().contains("ya29.c.ElouBywiys0Ly"));
assert!(Utc::now() + chrono::Duration::seconds(3600) >= tok.expiration_time().unwrap());
assert!(OffsetDateTime::now_utc() + time::Duration::seconds(3600) >= tok.expiration_time().unwrap());
}
#[tokio::test]