def test_deleteItems_success(self):
     ItemUtil.createItem(guild_id=1,
                         item_name="hello",
                         item_type=ItemType.ATTACK,
                         buff_type=1,
                         buff_value=-1,
                         buff_round=2,
                         level_required=0,
                         price=1)
     ItemUtil.createItem(guild_id=1,
                         item_name="hey",
                         item_type=ItemType.STATUS,
                         buff_type=2,
                         buff_value=10,
                         buff_round=3,
                         level_required=0,
                         price=1)
     ItemUtil.createItem(guild_id=1,
                         item_name="heap",
                         item_type=ItemType.STATUS,
                         buff_type=2,
                         buff_value=10,
                         buff_round=3,
                         level_required=0,
                         price=1)
     ItemUtil.createItem(guild_id=1,
                         item_name="hot",
                         item_type=ItemType.STATUS,
                         buff_type=2,
                         buff_value=10,
                         buff_round=3,
                         level_required=0,
                         price=1)
     ItemUtil.deleteItems(guild_id=1)
     result = ItemUtil.ListAllItem(guild_id=1)
     assert result == []
 def test_deleteItems_failed_noItem(self):
     ItemUtil.deleteItems(guild_id=1)
     result = ItemUtil.ListAllItem(guild_id=1)
     assert result == []
Beispiel #3
0
 async def clear_all_items(self, ctx: commands.Command):
     ItemUtil.deleteItems(ctx.guild.id)
     await ctx.send("本群所有item清理結束")