def test_tick_mood_int(self): """Test tick mood with int amounts.""" agent = Agent(.01, -.01, .01, -.01, .01) agent.emotions = [Joy(1)] agent.tick_mood() self.assertEqual(len(agent.emotions), 1) self.assertEqual(agent.emotions[0].amount, .5)
def test_tick_mood(self): agent = Agent(.01, -.01, .01, -.01, .01) self.assertEqual(agent.mood.type, "Disdainful") agent.emotions = [Joy(.05)] agent.tick_mood() self.assertEqual(len(agent.emotions), 1) self.assertEqual(agent.emotions[0].amount, .025) self.assertEqual(agent.mood.type, "Relaxed") # After enough ticks, the emotion should be removed from memory agent.tick_mood() agent.tick_mood() self.assertEqual(len(agent.emotions), 0) self.assertEqual(agent.mood.type, "Disdainful")