chorus/tests/guild.rs

38 lines
888 B
Rust
Raw Normal View History

2023-05-27 22:11:35 +02:00
use chorus::types::{Guild, GuildCreateSchema};
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-19 10:27:32 +02:00
assert!(Guild::delete(&mut bundle.user, &guild.id.to_string())
.await
2023-06-20 18:33:37 +02:00
.is_ok());
2023-05-27 22:11:35 +02:00
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;
}