def test_give_command(self):
        from shinymud.models.area import Area
        from shinymud.data import config
        from shinymud.models.player import Player
        from shinymud.commands.commands import Give
        area = Area.create({'name':'blarg'})
        room = area.new_room()
        bob = Player(('bob', 'bar'))
        bob.mode = None
        bob.playerize({'name':'bob', 'password':'pork'})
        alice = Player(('alice', 'bar'))
        alice.mode = None
        alice.playerize({'name':'alice', 'password':'pork'})
        self.world.player_add(bob)
        self.world.player_add(alice)
        
        room.add_char(bob)
        room.add_char(alice)
        alice.location = room
        bob.location = room
        proto_npc = area.new_npc()
        npc = proto_npc.load()
        room.add_char(npc)
        
        item = area.new_item()
        item.build_set_keywords('bauble', bob)
        item.build_set_name('a bauble', bob)
        bob.item_add(item.load())
        
        self.assertEqual(len(bob.inventory), 1)
        Give(bob, 'bauble to alice', 'give').run()
        self.assertEqual(len(bob.inventory), 0)
        self.assertEqual(len(alice.inventory), 1)
        to_alice = 'Bob gives you a bauble.'
        self.assertTrue(to_alice in alice.outq)
        to_bob = 'You give a bauble to Alice.'
        self.assertTrue(bob.outq in to_bob)
        
        Give(alice, 'bauble to shiny', 'give').run()
        self.assertEqual(len(alice.inventory), 0)
        self.assertEqual(len(npc.inventory), 1)
        to_alice = 'You give a bauble to %s.' % npc.name
        alice.world.log.debug(alice.outq)
        self.assertTrue(to_alice in alice.outq)
        to_shiny = 'Alice gives you a bauble.'
        self.assertTrue(to_shiny in npc.actionq)
        
        #Test Money
        bob.currency = 100
        com = config.CURRENCY + ' to alice'
        #Test give one currency unit
        self.assertEqual(alice.currency, 0)
        Give(bob, com, 'give').run()
        self.assertEqual(bob.currency, 99)
        self.assertEqual(alice.currency, 1)
        #test give multiple currencies
        com = '99' + config.CURRENCY + ' to alice'
        Give(bob, com, 'give').run()
        self.assertEqual(bob.currency, 0)
        self.assertEqual(alice.currency, 100)
        #test give more than bob has
        com = '1000' + config.CURRENCY + ' to alice'
        Give(bob, com, 'give').run()
        self.assertEqual(bob.currency, 0)
        self.assertEqual(alice.currency, 100)
dataset/ETHPy150Open shinymud/ShinyMUD/tests/shinytest/commands/test_commands.py/TestGeneralCommands.test_give_command/swapped operands of `in`