otherbots unit test
All checks were successful
ci/woodpecker/pr/cargo-checks Pipeline was successful

This commit is contained in:
ModulatingForce 2024-03-20 19:26:04 -04:00
parent e22e755bf5
commit e86fa4884b

View file

@ -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);