def test_chat_command(self):
        from shinymud.models.area import Area
        from shinymud.data import config
        from shinymud.models.player import Player
        from shinymud.commands.commands import Chat

        bob = Player(('bob', 'bar'))
        alice = Player(('alice', 'bar'))
        sam = Player(('sam', 'bar'))
        bob.mode = None
        bob.playerize({'name':'bob', 'password':'pork'})
        bob.outq = []
        sam.mode = None
        sam.playerize({'name':'sam', 'password':'pork'})
        sam.outq = []
        self.world.player_add(bob)
        self.world.player_add(sam)
        self.world.player_add(alice)
        
        Chat(bob, 'lol, hey guys!', 'chat').run()
        chat = config.chat_color + 'Bob chats, "lol, hey guys!"' + config.clear_fcolor
        self.assertTrue(chat in sam.outq)
        self.assertTrue(chat in bob.outq)
        self.assertFalse(chat in alice.outq)
        
        sam.channels['chat'] = False
        print sam.channels
        print bob.channels
        sam.outq = []
        bob.outq = []
        alice.outq = []
        
        Chat(bob, 'lol, hey guys!', 'chat').run()
        print sam.channels
        print sam.outq
        print bob.channels
        print bob.outq
        self.assertFalse(chat in sam.outq)
        self.assertTrue(chat in bob.outq)
        self.assertFalse(chat in alice.outq)
dataset/ETHPy150Open shinymud/ShinyMUD/tests/shinytest/commands/test_commands.py/TestGeneralCommands.test_chat_command/original