otherbots unit test
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful
This commit is contained in:
parent
e22e755bf5
commit
e86fa4884b
1 changed files with 29 additions and 1 deletions
|
@ -578,7 +578,7 @@ pub enum UserRole {
|
|||
Broadcaster,
|
||||
BotAdmin,
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq, Eq)]
|
||||
pub enum Permissible {
|
||||
Allow,
|
||||
Block,
|
||||
|
@ -1429,6 +1429,34 @@ mod core_identity {
|
|||
);
|
||||
}
|
||||
|
||||
|
||||
#[tokio::test]
|
||||
async fn otherbots_checks() {
|
||||
Log::set_file_ext(Extension::Log);
|
||||
|
||||
let mut test_id_mgr = IdentityManager::init();
|
||||
|
||||
for bot in otherbots_vector() {
|
||||
|
||||
let (usr, channelname, chat_badge, cmdreqroles) = (
|
||||
bot,
|
||||
ChType::Channel("twitchchanneltest".to_string()),
|
||||
None,
|
||||
vec![]
|
||||
);
|
||||
|
||||
let rslt = test_id_mgr.can_user_run(usr, channelname, chat_badge, cmdreqroles).await;
|
||||
|
||||
assert_eq!(
|
||||
(Permissible::Block,
|
||||
ChangeResult::NoChange("Other Bots Cannot Run Commands".to_string())),
|
||||
rslt
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#[tokio::test]
|
||||
async fn promote_workflow_01() {
|
||||
Log::set_file_ext(Extension::Log);
|
||||
|
|
Loading…
Reference in a new issue