chorus/tests/channel.rs

41 lines
980 B
Rust
Raw Normal View History

2023-05-27 22:12:15 +02:00
mod common;
use chorus::types::Channel;
#[tokio::test]
async fn get_channel() {
let mut bundle = common::setup().await;
let bundle_channel = bundle.channel.clone();
let bundle_user = &mut bundle.user;
assert_eq!(
bundle_channel,
Channel::get(
bundle_user.token.as_str(),
bundle.instance.urls.get_api(),
&bundle_channel.id.to_string(),
&mut bundle_user.limits,
&mut bundle.instance.limits
)
.await
.unwrap()
);
common::teardown(bundle).await
}
2023-05-28 23:04:56 +02:00
#[tokio::test]
async fn delete_channel() {
let mut bundle = common::setup().await;
let result = bundle
.channel
2023-05-29 18:29:08 +02:00
.clone()
2023-05-28 23:04:56 +02:00
.delete(
&bundle.user.token,
bundle.instance.urls.get_api(),
&mut bundle.user.limits,
&mut bundle.instance.limits,
)
.await;
assert!(result.is_none());
2023-05-29 18:29:08 +02:00
common::teardown(bundle).await
2023-05-28 23:04:56 +02:00
}