From 27f90bbaef3ee76324f0f19e8c146642bbfb9cb0 Mon Sep 17 00:00:00 2001 From: imcompiling Date: Wed, 8 Nov 2023 15:51:06 -0500 Subject: [PATCH] Add test for term start. --- cogs/commands/test.py | 40 +++++++++++++++++++++++++++++++++++----- 1 file changed, 35 insertions(+), 5 deletions(-) diff --git a/cogs/commands/test.py b/cogs/commands/test.py index 1838b08..2ee737d 100644 --- a/cogs/commands/test.py +++ b/cogs/commands/test.py @@ -61,7 +61,11 @@ class TestCog(commands.Cog, name="Test commands."): """ config: DakinyConfig = self.bot.config - cycle = ElectionCycle(get_current_cycle(config), config, self.bot.get_guild(config.params.guild_id)) + cycle = ElectionCycle( + get_current_cycle(config), + config, + self.bot.get_guild(config.params.guild_id), + ) await cycle.election_start_action() @test.subcommand() @@ -73,7 +77,11 @@ class TestCog(commands.Cog, name="Test commands."): interaction (nextcord.Interaction): _description_ """ config: DakinyConfig = self.bot.config - cycle = ElectionCycle(get_current_cycle(config), config, self.bot.get_guild(config.params.guild_id)) + cycle = ElectionCycle( + get_current_cycle(config), + config, + self.bot.get_guild(config.params.guild_id), + ) await cycle.voting_start_action() @test.subcommand() @@ -85,17 +93,39 @@ class TestCog(commands.Cog, name="Test commands."): interaction (nextcord.Interaction): _description_ """ config: DakinyConfig = self.bot.config - cycle = ElectionCycle(get_current_cycle(config), config, self.bot.get_guild(config.params.guild_id)) + cycle = ElectionCycle( + get_current_cycle(config), + config, + self.bot.get_guild(config.params.guild_id), + ) await cycle.voting_end_action() @test.subcommand() async def election_reminder(self, interaction: nextcord.Interaction): config: DakinyConfig = self.bot.config - cycle = ElectionCycle(get_current_cycle(config), config, self.bot.get_guild(config.params.guild_id)) + cycle = ElectionCycle( + get_current_cycle(config), + config, + self.bot.get_guild(config.params.guild_id), + ) await cycle.election_reminder() @test.subcommand() async def daily(self, interaction: nextcord.Interaction): config: DakinyConfig = self.bot.config - cycle = ElectionCycle(get_current_cycle(config), config, self.bot.get_guild(config.params.guild_id)) + cycle = ElectionCycle( + get_current_cycle(config), + config, + self.bot.get_guild(config.params.guild_id), + ) await cycle.check_date() + + @test.subcommand() + async def term_start(self, interaction: nextcord.Interaction): + config: DakinyConfig = self.bot.config + cycle = ElectionCycle( + get_current_cycle(config), + config, + self.bot.get_guild(config.params.guild_id), + ) + await cycle.term_start_action()