1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2024-11-22 11:31:08 +00:00

wip: add follow test

This commit is contained in:
Felix Ableitner 2023-11-15 15:07:02 +01:00
parent 1098ecd4a1
commit 7e75c77219

View file

@ -5,7 +5,7 @@ use fediwiki::start;
#[tokio::test] #[tokio::test]
async fn test_get_article() { async fn test_get_article() {
let hostname = "localhost:8131"; let hostname = "localhost:8131";
let join = tokio::task::spawn(async { let handle = tokio::task::spawn(async {
start(hostname).await.unwrap(); start(hostname).await.unwrap();
}); });
@ -18,5 +18,20 @@ async fn test_get_article() {
.unwrap(); .unwrap();
assert_eq!(title, res.title); assert_eq!(title, res.title);
assert!(res.local); assert!(res.local);
join.abort(); handle.abort();
} }
#[tokio::test]
async fn test_follow_instance() {
let hostname_alpha = "localhost:8131";
let hostname_beta = "localhost:8132";
let handle_alpha = tokio::task::spawn(async {
start(hostname_alpha).await.unwrap();
});
let handle_beta = tokio::task::spawn(async {
start(hostname_beta).await.unwrap();
});
handle_alpha.abort();
handle_beta.abort();
}