Fixed grammar, unified the docstring's format and added documentation to some classes that did not have any. Closes #32.
This commit is contained in:
@ -21,7 +21,7 @@ from ..translations import gettext as _, Translator
|
||||
class TestGame(unittest.TestCase):
|
||||
def setUp(self) -> None:
|
||||
"""
|
||||
Setup game.
|
||||
Sets the game up.
|
||||
"""
|
||||
self.game = Game()
|
||||
self.game.new_game()
|
||||
@ -31,7 +31,7 @@ class TestGame(unittest.TestCase):
|
||||
|
||||
def test_load_game(self) -> None:
|
||||
"""
|
||||
Save a game and reload it.
|
||||
Saves a game and reloads it.
|
||||
"""
|
||||
bomb = Bomb()
|
||||
self.game.map.add_entity(bomb)
|
||||
@ -85,7 +85,7 @@ class TestGame(unittest.TestCase):
|
||||
|
||||
def test_bootstrap_fail(self) -> None:
|
||||
"""
|
||||
Ensure that the test can't play the game,
|
||||
Ensures that the test can't play the game,
|
||||
because there is no associated shell.
|
||||
Yeah, that's only for coverage.
|
||||
"""
|
||||
@ -94,7 +94,7 @@ class TestGame(unittest.TestCase):
|
||||
|
||||
def test_key_translation(self) -> None:
|
||||
"""
|
||||
Test key bindings.
|
||||
Tests key bindings.
|
||||
"""
|
||||
self.game.settings = Settings()
|
||||
|
||||
@ -150,7 +150,7 @@ class TestGame(unittest.TestCase):
|
||||
|
||||
def test_key_press(self) -> None:
|
||||
"""
|
||||
Press a key and see what is done.
|
||||
Presses a key and asserts what is done is correct.
|
||||
"""
|
||||
self.assertEqual(self.game.state, GameMode.MAINMENU)
|
||||
self.assertEqual(self.game.main_menu.validate(),
|
||||
@ -241,7 +241,7 @@ class TestGame(unittest.TestCase):
|
||||
|
||||
def test_mouse_click(self) -> None:
|
||||
"""
|
||||
Simulate mouse clicks.
|
||||
Simulates mouse clicks.
|
||||
"""
|
||||
self.game.state = GameMode.MAINMENU
|
||||
|
||||
@ -271,7 +271,7 @@ class TestGame(unittest.TestCase):
|
||||
|
||||
def test_new_game(self) -> None:
|
||||
"""
|
||||
Ensure that the start button starts a new game.
|
||||
Ensures that the start button starts a new game.
|
||||
"""
|
||||
old_map = self.game.map
|
||||
old_player = self.game.player
|
||||
@ -294,7 +294,7 @@ class TestGame(unittest.TestCase):
|
||||
|
||||
def test_settings_menu(self) -> None:
|
||||
"""
|
||||
Ensure that the settings menu is working properly.
|
||||
Ensures that the settings menu is working properly.
|
||||
"""
|
||||
self.game.settings = Settings()
|
||||
|
||||
@ -380,7 +380,7 @@ class TestGame(unittest.TestCase):
|
||||
|
||||
def test_dead_screen(self) -> None:
|
||||
"""
|
||||
Kill player and render dead screen.
|
||||
Kills the player and renders the dead message on the fake screen.
|
||||
"""
|
||||
self.game.state = GameMode.PLAY
|
||||
# Kill player
|
||||
@ -396,13 +396,13 @@ class TestGame(unittest.TestCase):
|
||||
|
||||
def test_not_implemented(self) -> None:
|
||||
"""
|
||||
Check that some functions are not implemented, only for coverage.
|
||||
Checks that some functions are not implemented, only for coverage.
|
||||
"""
|
||||
self.assertRaises(NotImplementedError, Display.display, None)
|
||||
|
||||
def test_messages(self) -> None:
|
||||
"""
|
||||
Display error messages.
|
||||
Displays error messages.
|
||||
"""
|
||||
self.game.message = "I am an error"
|
||||
self.game.display_actions(DisplayActions.UPDATE)
|
||||
@ -412,7 +412,7 @@ class TestGame(unittest.TestCase):
|
||||
|
||||
def test_inventory_menu(self) -> None:
|
||||
"""
|
||||
Open the inventory menu and interact with items.
|
||||
Opens the inventory menu and interacts with items.
|
||||
"""
|
||||
self.game.state = GameMode.PLAY
|
||||
# Open and close the inventory
|
||||
@ -473,7 +473,7 @@ class TestGame(unittest.TestCase):
|
||||
|
||||
def test_talk_to_sunflowers(self) -> None:
|
||||
"""
|
||||
Interact with sunflowers
|
||||
Interacts with sunflowers.
|
||||
"""
|
||||
self.game.state = GameMode.PLAY
|
||||
|
||||
@ -524,7 +524,7 @@ class TestGame(unittest.TestCase):
|
||||
|
||||
def test_talk_to_merchant(self) -> None:
|
||||
"""
|
||||
Interact with merchants
|
||||
Interacts with merchants.
|
||||
"""
|
||||
self.game.state = GameMode.PLAY
|
||||
|
||||
|
Reference in New Issue
Block a user