2023-05-27 22:11:35 +02:00
|
|
|
use chorus::types::{Guild, GuildCreateSchema};
|
|
|
|
|
2023-06-11 13:52:31 +02:00
|
|
|
mod common;
|
|
|
|
|
2023-05-27 22:11:35 +02:00
|
|
|
#[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-06-22 13:14:07 +02:00
|
|
|
assert!(Guild::delete(&mut bundle.user, guild.id).await.is_ok());
|
2023-05-27 22:11:35 +02:00
|
|
|
common::teardown(bundle).await
|
|
|
|
}
|
2023-05-29 16:51:28 +02:00
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn get_channels() {
|
|
|
|
let mut bundle = common::setup().await;
|
2023-08-13 15:54:07 +02:00
|
|
|
let guild = bundle.guild.read().unwrap().clone();
|
|
|
|
println!("{:?}", guild.channels(&mut bundle.user).await.unwrap());
|
2023-05-29 16:51:28 +02:00
|
|
|
common::teardown(bundle).await;
|
|
|
|
}
|