def setUp(self): """Sets up fresh objects for each test.""" self.bot = helpers.MockBot() self.cog = information.Information(self.bot) self.ctx = helpers.MockContext() self.ctx.author.roles.append(self.moderator_role)
def setUp(self): """Set up steps executed before each test is run.""" self.bot = helpers.MockBot() self.cog = information.Information(self.bot) self.moderator_role = helpers.MockRole(name="Moderators", id=2, position=10) self.flautist_role = helpers.MockRole(name="Flautists", id=3, position=2) self.bassist_role = helpers.MockRole(name="Bassists", id=4, position=3) self.author = helpers.MockMember(id=1, name="syntaxaire") self.moderator = helpers.MockMember(id=2, name="riffautae", roles=[self.moderator_role]) self.target = helpers.MockMember(id=3, name="__fluzz__") # There's no way to mock the channel constant without deferring imports. The constant is # used as a default value for a parameter, which gets defined upon import. self.bot_command_channel = helpers.MockTextChannel(id=constants.Channels.bot_commands)
def setUp(self): """Common set-up steps done before for each test.""" self.bot = helpers.MockBot() self.bot.api_client.get = unittest.mock.AsyncMock() self.cog = information.Information(self.bot)