Ejemplo n.º 1
0
 def setUp(self):
     super().setUp()
     self.container = Container(self.game, "box")
     self.container.can_contain_standing_player = True
     self.start_room.addThing(self.container)
     ClimbInVerb()._runVerbFuncAndEvents(self.game, self.container)
     self.assertIs(self.me.location, self.container)
Ejemplo n.º 2
0
    def test_climb_in_cannot_sit_stand_lie(self):
        FAILURE_MSG = f"You cannot climb into {self.container.lowNameArticle(True)}. "

        self.assertIs(self.me.location, self.start_room,
                      "Player needs to start in start_room")
        ClimbInVerb()._runVerbFuncAndEvents(self.game, self.container)
        self.assertIs(self.me.location, self.start_room)

        msg = self.app.print_stack.pop()
        self.assertEqual(msg, FAILURE_MSG)
Ejemplo n.º 3
0
    def test_climb_in_can_stand(self):
        SUCCESS_MSG = f"You stand in {self.container.lowNameArticle(True)}. "

        self.container.can_contain_standing_player = True

        self.assertIs(self.me.location, self.start_room,
                      "Player needs to start in start_room")
        ClimbInVerb()._runVerbFuncAndEvents(self.game, self.container)
        self.assertIs(self.me.location, self.container)

        msg = self.app.print_stack.pop()
        self.assertEqual(msg, SUCCESS_MSG)
Ejemplo n.º 4
0
    def test_climb_in_can_stand(self):
        FAILURE_MSG = (
            f"You cannot climb into {self.container.lowNameArticle(True)}, "
            "since it is closed. ")

        self.container.can_contain_standing_player = True

        self.assertIs(self.me.location, self.start_room,
                      "Player needs to start in start_room")
        ClimbInVerb()._runVerbFuncAndEvents(self.game, self.container)
        self.assertIs(self.me.location, self.start_room)

        msg = self.app.print_stack.pop()
        self.assertEqual(msg, FAILURE_MSG)