示例#1
0
 def test_desc_contains_contents_if_desc_reveal(self):
     subject = Surface(self.game, self._get_unique_noun())
     subject.desc_reveal = True
     content = Thing(self.game, self._get_unique_noun())
     subject.addThing(content)
     self.start_room.addThing(subject)
     self.game.turnMain(f"l")
     msg = self.app.print_stack.pop()
     self.assertIn(content.verbose_name, msg)
示例#2
0
    def test_take_all_does_not_take_items_that_are_not_discovered(self):
        desk = Surface(self.game, "desk")
        desk.inv_item = False
        desk.desc_reveal = False  # don't reveal the contents with "look"
        desk.moveTo(self.start_room)
        hat = Thing(self.game, "hat")
        hat.moveTo(desk)

        self.game.turnMain("l")
        self.game.turnMain("take all")

        self.assertTrue(self.game.me.containsItem(hat))
示例#3
0
    def test_take_all_takes_known_objects_from_sub_locations(self):
        desk = Surface(self.game, "desk")
        desk.inv_item = False
        desk.desc_reveal = True
        desk.moveTo(self.start_room)
        hat = Thing(self.game, "hat")
        hat.moveTo(desk)

        self.game.turnMain("l")
        self.game.turnMain("take all")

        self.assertTrue(self.game.me.containsItem(hat))