this repo has no description
1mod common; 2use common::*; 3use reqwest::StatusCode; 4 5use std::collections::HashMap; 6 7#[tokio::test] 8async fn test_get_timeline() { 9 let client = client(); 10 let params = [("limit", "30")]; 11 let res = client.get(format!("{}/xrpc/app.bsky.feed.getTimeline", base_url().await)) 12 .query(&params) 13 .bearer_auth(AUTH_TOKEN) 14 .send() 15 .await 16 .expect("Failed to send request"); 17 18 assert_eq!(res.status(), StatusCode::OK); 19} 20 21#[tokio::test] 22async fn test_get_author_feed() { 23 let client = client(); 24 let params = [ 25 ("actor", AUTH_DID), 26 ("limit", "30") 27 ]; 28 let res = client.get(format!("{}/xrpc/app.bsky.feed.getAuthorFeed", base_url().await)) 29 .query(&params) 30 .bearer_auth(AUTH_TOKEN) 31 .send() 32 .await 33 .expect("Failed to send request"); 34 35 assert_eq!(res.status(), StatusCode::OK); 36} 37 38#[tokio::test] 39async fn test_get_post_thread() { 40 let client = client(); 41 let mut params = HashMap::new(); 42 params.insert("uri", "at://did:plc:other/app.bsky.feed.post/3k12345"); 43 params.insert("depth", "5"); 44 45 let res = client.get(format!("{}/xrpc/app.bsky.feed.getPostThread", base_url().await)) 46 .query(&params) 47 .bearer_auth(AUTH_TOKEN) 48 .send() 49 .await 50 .expect("Failed to send request"); 51 52 assert_eq!(res.status(), StatusCode::OK); 53}