Fix linting
This commit is contained in:
parent
f4965039ee
commit
cddff5c2d9
|
@ -53,7 +53,8 @@ class KeyValues(Enum):
|
||||||
DANCE = auto()
|
DANCE = auto()
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def translate_key(key: str, settings: Settings) -> Optional["KeyValues"]:
|
def translate_key(key: str, settings: Settings) \
|
||||||
|
-> Optional["KeyValues"]: # noqa: C901
|
||||||
"""
|
"""
|
||||||
Translates the raw string key into an enum value that we can use.
|
Translates the raw string key into an enum value that we can use.
|
||||||
"""
|
"""
|
||||||
|
@ -91,4 +92,3 @@ class KeyValues(Enum):
|
||||||
return KeyValues.LAUNCH
|
return KeyValues.LAUNCH
|
||||||
elif key == settings.KEY_DANCE:
|
elif key == settings.KEY_DANCE:
|
||||||
return KeyValues.DANCE
|
return KeyValues.DANCE
|
||||||
return None
|
|
||||||
|
|
|
@ -260,12 +260,10 @@ class TestGame(unittest.TestCase):
|
||||||
self.game.handle_key_pressed(KeyValues.DANCE)
|
self.game.handle_key_pressed(KeyValues.DANCE)
|
||||||
self.assertEqual(rabbit.confused, 1)
|
self.assertEqual(rabbit.confused, 1)
|
||||||
string = rabbit.hit(self.game.player)
|
string = rabbit.hit(self.game.player)
|
||||||
self.assertEqual(string,
|
self.assertEqual(
|
||||||
"{name} is confused, it can not hit {opponent}."
|
string, _("{name} is confused, it can not hit {opponent}.")
|
||||||
.format(name=_(rabbit.translated_name.capitalize()
|
.format(name=rabbit.translated_name.capitalize(),
|
||||||
), opponent=_(
|
opponent=self.game.player.translated_name))
|
||||||
self.game.player.translated_name
|
|
||||||
)))
|
|
||||||
rabbit.confused = 0
|
rabbit.confused = 0
|
||||||
self.game.player.charisma = 0
|
self.game.player.charisma = 0
|
||||||
self.game.handle_key_pressed(KeyValues.DANCE)
|
self.game.handle_key_pressed(KeyValues.DANCE)
|
||||||
|
|
Loading…
Reference in New Issue