old_contents: import unittest
  from gather.discord_gather import DiscordGather
  from .helper import async_test
  
  
  class TestDiscordGather(unittest.TestCase):
      @async_test
      async def test_on_ready(self):
          bot = DiscordGather('token')
          bot.discord = unittest.mock.Mock()
          bot.discord.username = 'testuser'
          await bot.on_ready()
          self.assertEqual(bot.bot.username, 'testuser')
  
      def test_on_member_update(self):
          pass
  
new_contents: import unittest
  import discord
  from gather.discord_gather import DiscordGather
  from .helper import async_test, get_mock_coro
  
  
  class TestDiscordGather(unittest.TestCase):
      @async_test
      async def test_on_ready(self):
          gather = DiscordGather('token')
          gather.discord = unittest.mock.Mock()
          gather.discord.username = 'testuser'
          await gather.on_ready()
          self.assertEqual(gather.bot.username, 'testuser')
  
      @async_test
      async def test_on_member_update_player_goes_offline(self):
          gather = DiscordGather('token')
          gather.bot = unittest.mock.Mock()
          gather.bot.member_went_offline = get_mock_coro(True)
          before = unittest.mock.Mock()
          before.status = discord.Status.online
          after = unittest.mock.Mock()
          after.status = discord.Status.offline
          await gather.on_member_update(before, after)
          self.assertTrue(gather.bot.member_went_offline.called)
  
      @async_test
      async def test_on_member_update_player_goes_afk(self):
          gather = DiscordGather('token')
          gather.bot = unittest.mock.Mock()
          gather.bot.member_went_afk = get_mock_coro(True)
          before = unittest.mock.Mock()
          before.status = discord.Status.online
          after = unittest.mock.Mock()
          after.status = discord.Status.idle
          await gather.on_member_update(before, after)
          self.assertTrue(gather.bot.member_went_afk.called)
  
subject: Add tests for events