Mysteriously fix tests
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
import curses
|
||||
from typing import Any, Union
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
from dungeonbattle.display.texturepack import TexturePack
|
||||
from dungeonbattle.tests.screen import FakePad
|
||||
|
||||
|
||||
@ -10,9 +11,9 @@ class Display:
|
||||
width: int
|
||||
height: int
|
||||
|
||||
def __init__(self, screen: Any, pack: Any):
|
||||
def __init__(self, screen: Any, pack: Optional[TexturePack] = None):
|
||||
self.screen = screen
|
||||
self.pack = pack
|
||||
self.pack = pack or TexturePack.get_pack("ascii")
|
||||
|
||||
def newpad(self, height: int, width: int) -> Union[FakePad, Any]:
|
||||
return curses.newpad(height, width) if self.screen else FakePad()
|
||||
|
@ -6,8 +6,8 @@ from dungeonbattle.entities.player import Player
|
||||
class StatsDisplay(Display):
|
||||
player: Player
|
||||
|
||||
def __init__(self, *args):
|
||||
super().__init__(*args)
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
self.pad = self.newpad(self.rows, self.cols)
|
||||
|
||||
def update_player(self, p: Player) -> None:
|
||||
|
Reference in New Issue
Block a user