chorus/tests/guild.rs

38 lines
931 B
Rust
Raw Normal View History

2023-05-27 22:11:35 +02:00
mod common;
use chorus::types::{Guild, GuildCreateSchema};
#[tokio::test]
async fn guild_creation_deletion() {
let mut bundle = common::setup().await;
let guild_create_schema = GuildCreateSchema {
name: Some("test".to_string()),
region: None,
icon: None,
channels: None,
guild_template_code: None,
system_channel_id: None,
rules_channel_id: None,
};
2023-05-29 23:16:43 +02:00
let guild = Guild::create(&mut bundle.user, guild_create_schema)
2023-05-27 22:11:35 +02:00
.await
.unwrap();
2023-05-29 23:51:12 +02:00
match Guild::delete(&mut bundle.user, &guild.id.to_string()).await {
2023-05-27 22:11:35 +02:00
None => assert!(true),
Some(_) => assert!(false),
}
common::teardown(bundle).await
}
#[tokio::test]
async fn get_channels() {
let mut bundle = common::setup().await;
println!(
"{:?}",
2023-05-29 23:59:13 +02:00
bundle.guild.channels(&mut bundle.user).await.unwrap()
);
common::teardown(bundle).await;
}