Modift get_mutual, add get_relationships

This commit is contained in:
Flori Weber 2023-06-18 15:39:40 +02:00
parent fc6b431ad8
commit 6ea587f096
No known key found for this signature in database
GPG Key ID: 0ACD574FCF5226CF
1 changed files with 35 additions and 4 deletions

View File

@ -18,9 +18,9 @@ async fn test_get_mutual_relationships() {
)
.unwrap();
let bundle = common::setup().await;
let mut belongs_to = bundle.instance;
let mut user = bundle.user;
let mut bundle = common::setup().await;
let belongs_to = &mut bundle.instance;
let user = &mut bundle.user;
let mut other_user = belongs_to.register_account(&register_schema).await.unwrap();
let friend_request_schema = types::FriendRequestSendSchema {
username: user.object.username.clone(),
@ -31,5 +31,36 @@ async fn test_get_mutual_relationships() {
.get_mutual_relationships(&other_user.object.id.to_string())
.await
.unwrap();
println!("{:?}", relationships.unwrap());
println!("{:?}", relationships);
common::teardown(bundle).await
}
#[tokio::test]
async fn test_get_relationships() {
let register_schema = types::RegisterSchema::new(
"integrationtestuser2".to_string(),
None,
true,
None,
None,
None,
Some("2000-01-01".to_string()),
None,
None,
None,
)
.unwrap();
let mut bundle = common::setup().await;
let belongs_to = &mut bundle.instance;
let user = &mut bundle.user;
let mut other_user = belongs_to.register_account(&register_schema).await.unwrap();
let friend_request_schema = types::FriendRequestSendSchema {
username: user.object.username.clone(),
discriminator: Some(user.object.discriminator.clone()),
};
other_user.send_friend_request(friend_request_schema).await;
let relationships = user.get_relationships().await.unwrap();
println!("{:?}", relationships);
common::teardown(bundle).await
}