Exemplo n.º 1
0
 def test_others(self):
     attic = Location("Attic", "A dark attic.")
     player = Player("merlin", "m")
     player.title = "wizard Merlin"
     julie = MsgTraceNPC("julie", "f", "human")
     fritz = MsgTraceNPC("fritz", "m", "human")
     julie.move(attic, silent=True)
     fritz.move(attic, silent=True)
     player.move(attic, silent=True)
     player.tell_others("one", "two", "three")
     self.assertEqual([], player.test_get_output_paragraphs())
     self.assertEqual(["one", "two", "three"], fritz.messages)
     self.assertEqual(["one", "two", "three"], julie.messages)
     fritz.clearmessages()
     julie.clearmessages()
     player.tell_others("{title} and {Title}")
     self.assertEqual(["wizard Merlin and Wizard Merlin"], fritz.messages)
Exemplo n.º 2
0
 def test_others(self):
     attic = Location("Attic", "A dark attic.")
     player = Player("merlin", "m")
     player.title = "wizard Merlin"
     julie = MsgTraceNPC("julie", "f", "human")
     fritz = MsgTraceNPC("fritz", "m", "human")
     julie.move(attic, silent=True)
     fritz.move(attic, silent=True)
     player.move(attic, silent=True)
     player.tell_others("one", "two", "three")
     self.assertEqual([], player.test_get_output_paragraphs())
     self.assertEqual(["one", "two", "three"], fritz.messages)
     self.assertEqual(["one", "two", "three"], julie.messages)
     fritz.clearmessages()
     julie.clearmessages()
     player.tell_others("{title} and {Title}")
     self.assertEqual(["wizard Merlin and Wizard Merlin"], fritz.messages)