'Test the object handler.'

def test_handler(self):

    self.assertIsNotNone(self.char1.callbacks)
    callback = self.room1.callbacks.add('dummy', 'pass', author=self.char1, valid=True)
    self.assertEqual(callback.obj, self.room1)
    self.assertEqual(callback.name, 'dummy')
    self.assertEqual(callback.code, 'pass')
    self.assertEqual(callback.author, self.char1)
    self.assertEqual(callback.valid, True)
    self.assertIn([callback], self.room1.callbacks.all().values())
    new = self.room1.callbacks.edit('dummy', 0, 'character.db.say    =    True', author=self.char1, valid=True)
    self.assertIn([new], self.room1.callbacks.all().values())
    self.assertNotIn([callback], self.room1.callbacks.all().values())
    self.assertTrue(self.room1.callbacks.call('dummy', locals={'character': self.char2}))
    self.assertTrue(self.char2.db.say)
    self.room1.callbacks.remove('dummy', 0)
    self.assertEqual(self.room1.callbacks.all(), {})
