Пример #1
0
    def test_pour_out_non_liquid_non_container_from_container(self):
        item = Thing(self.game, "bead")
        item.size = 2
        item.moveTo(self.old_container)
        self.old_container.removeThing(self.liquid)

        self.game.turnMain("pour bottle into bowl")
        self.assertIn("You dump the bottle", self.app.print_stack.pop())
Пример #2
0
    def test_fill_container_from_container_containing_only_non_liquids(self):
        item = Thing(self.game, "bead")
        item.size = 2
        item.moveTo(self.old_container)
        self.old_container.removeThing(self.liquid)

        self.game.turnMain("fill bowl from bottle")
        self.assertIn("no liquid in", self.app.print_stack.pop())
    def test_pour_out_non_liquid_non_container_item_too_large(self):
        item = Thing(self.game, "bead")
        item.size = 100
        item.moveTo(self.old_container)
        self.old_container.removeThing(self.liquid)

        self.game.turnMain("pour bottle into bowl")
        self.assertIn("too large to fit inside", self.app.print_stack.pop())
    def test_pour_non_liquid_into_non_container(self):
        item = Thing(self.game, "bead")
        item.size = 2
        item.moveTo(self.old_container)
        self.old_container.removeThing(self.liquid)

        rock = Thing(self.game, "rock")
        rock.moveTo(self.start_room)

        self.game.turnMain("pour bottle into rock")
        self.assertIn("not a container", self.app.print_stack.pop())
Пример #5
0
    def test_set_in_gives_too_big_message_if_item_too_big(self):
        item = Thing(self.game, "giant")
        item.size = 100000
        self.me.addThing(item)
        place = Container(self.game, "place")
        self.start_room.addThing(place)

        self.game.turnMain(f"set giant in place")

        self.assertIn("too big", self.app.print_stack.pop())
        self.assertFalse(place.containsItem(item))
Пример #6
0
    def test_pour_out_non_liquid_non_container_item_too_large(self):
        item = Thing(self.game, "bead")
        item.size = 100
        item.moveTo(self.old_container)
        self.old_container.removeThing(self.liquid)

        self.game.turnMain("pour bottle into bowl")
        self.assertIn(
            self.new_container.does_not_fit_msg.format(
                item=item, self=self.new_container),
            self.app.print_stack,
        )