コード例 #1
0
ファイル: test_game.py プロジェクト: LuisAyuso/TeleAdventure
    def test_lifetime(self):
        print "hello"
        self.assertTrue(True)

        g = Game()
        self.assertTrue(g.is_game_alive())
        g.kill_game()
        self.assertFalse(g.is_game_alive())
コード例 #2
0
ファイル: test_game.py プロジェクト: LuisAyuso/TeleAdventure
    def test_parsing(self):
        g = Game()
        self.assertTrue(g.is_game_alive())

        out = g.read_game_status()
        self.assertNotEquals(len(out), 0)
        print out
        out = ""

        g.send_input("open door")
        out = g.read_game_status()
        self.assertNotEquals(len(out), 0)
        print out
        out = ""

        g.send_input("go north")
        out = g.read_game_status()
        self.assertNotEquals(len(out), 0)
        print out
        out = ""

        g.send_input("go north")
        out = g.read_game_status()
        self.assertNotEquals(len(out), 0)
        print out
        out = ""

        g.send_input("open window")
        out = g.read_game_status()
        self.assertNotEquals(len(out), 0)
        print out
        out = ""

        g.kill_game()

        self.assertFalse(True)