Replace guild_id with guild object

This commit is contained in:
bitfl0wer 2023-05-29 16:51:41 +02:00
parent d51291de3c
commit 789d7ec7e8
No known key found for this signature in database
GPG Key ID: 84BBB60DF895ABF2
1 changed files with 5 additions and 5 deletions

View File

@ -9,7 +9,7 @@ pub struct TestBundle {
pub urls: URLBundle,
pub user: UserMeta,
pub instance: Instance,
pub guild_id: String,
pub guild: Guild,
pub channel: Channel,
}
@ -65,13 +65,13 @@ pub async fn setup() -> TestBundle {
video_quality_mode: None,
};
let mut user = instance.register_account(&reg).await.unwrap();
let guild_id = Guild::create(&mut user, urls.get_api(), guild_create_schema)
let guild = Guild::create(&mut user, urls.get_api(), guild_create_schema)
.await
.unwrap();
let channel = Channel::create(
&user.token,
urls.get_api(),
guild_id.as_str(),
&guild.id.to_string(),
channel_create_schema,
&mut user.limits,
&mut instance.limits,
@ -83,7 +83,7 @@ pub async fn setup() -> TestBundle {
urls,
user,
instance,
guild_id,
guild,
channel,
}
}
@ -93,7 +93,7 @@ pub async fn teardown(mut bundle: TestBundle) {
Guild::delete(
&mut bundle.user,
bundle.instance.urls.get_api(),
bundle.guild_id,
&bundle.guild.id.to_string(),
)
.await;
bundle.user.delete().await;