Slightly cover bootstrap, to increase more and more coverage. Ensure that there is no associated shell
This commit is contained in:
@ -1,8 +1,9 @@
|
||||
import os
|
||||
import unittest
|
||||
|
||||
from dungeonbattle.bootstrap import Bootstrap
|
||||
from dungeonbattle.display.display import Display
|
||||
from dungeonbattle.display.display_manager import DisplayManager
|
||||
from dungeonbattle.display.statsdisplay import StatsDisplay
|
||||
from dungeonbattle.game import Game, KeyValues, GameMode
|
||||
from dungeonbattle.menus import MainMenuValues
|
||||
|
||||
@ -21,6 +22,15 @@ class TestGame(unittest.TestCase):
|
||||
self.assertRaises(NotImplementedError, Game.load_game, "game.save")
|
||||
self.assertRaises(NotImplementedError, Display(None).display)
|
||||
|
||||
def test_bootstrap_fail(self) -> None:
|
||||
"""
|
||||
Ensure that the test can't play the game,
|
||||
because there is no associated shell.
|
||||
Yeah, that's only for coverage.
|
||||
"""
|
||||
self.assertRaises(Exception, Bootstrap.run_game)
|
||||
self.assertEqual(os.getenv("TERM", "unknown"), "unknown")
|
||||
|
||||
def test_key_translation(self) -> None:
|
||||
"""
|
||||
Test key bindings.
|
||||
@ -106,9 +116,3 @@ class TestGame(unittest.TestCase):
|
||||
|
||||
self.game.handle_key_pressed(KeyValues.SPACE)
|
||||
self.assertEqual(self.game.state, GameMode.MAINMENU)
|
||||
|
||||
def test_stats_display(self) -> None:
|
||||
self.game.current_display = StatsDisplay(None)
|
||||
self.game.current_display.update_player(self.game.player)
|
||||
self.game.current_display.resize(0, 0, 42, 42)
|
||||
self.game.current_display.refresh()
|
||||
|
Reference in New Issue
Block a user