From e86fa4884bab2e252072dc513d7b94e4d671bec0 Mon Sep 17 00:00:00 2001 From: ModulatingForce <116608425+modulatingforce@users.noreply.github.com> Date: Wed, 20 Mar 2024 19:26:04 -0400 Subject: [PATCH] otherbots unit test --- src/core/identity.rs | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/src/core/identity.rs b/src/core/identity.rs index 5cdfd5f..f5e710b 100644 --- a/src/core/identity.rs +++ b/src/core/identity.rs @@ -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);