better test log

This commit is contained in:
phiresky 2023-07-23 21:09:08 +00:00
parent 5da52d4ce1
commit dd1cd5eeb1
2 changed files with 7 additions and 9 deletions

View file

@ -260,9 +260,9 @@ pub mod tests {
#[test]
fn test_should_refetch_object() {
let one_second_ago = Utc::now() - ChronoDuration::seconds(1);
assert!(!should_refetch_object(one_second_ago.into()));
assert!(!should_refetch_object(one_second_ago));
let two_days_ago = Utc::now() - ChronoDuration::days(2);
assert!(should_refetch_object(two_days_ago.into()));
assert!(should_refetch_object(two_days_ago));
}
}

View file

@ -221,7 +221,7 @@ mod tests {
};
#[tokio::test]
async fn test_webfinger() {
async fn test_webfinger() -> Result<(), Error> {
let config = FederationConfig::builder()
.domain("example.com")
.app_data(DbConnection)
@ -229,12 +229,10 @@ mod tests {
.await
.unwrap();
let data = config.to_request_data();
let res =
webfinger_resolve_actor::<DbConnection, DbUser>("LemmyDev@mastodon.social", &data)
.await;
assert!(res.is_ok());
webfinger_resolve_actor::<DbConnection, DbUser>("LemmyDev@mastodon.social", &data).await?;
// poa.st is as of 2023-07-14 the largest Pleroma instance
let res = webfinger_resolve_actor::<DbConnection, DbUser>("graf@poa.st", &data).await;
assert!(res.is_ok());
webfinger_resolve_actor::<DbConnection, DbUser>("graf@poa.st", &data).await?;
Ok(())
}
}