Use a fake pad to make tests runnable
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
import curses
|
||||
from typing import Any
|
||||
from typing import Any, Union
|
||||
|
||||
from dungeonbattle.tests.screen import FakePad
|
||||
|
||||
|
||||
class Display:
|
||||
@ -10,3 +12,9 @@ class Display:
|
||||
|
||||
def refresh(self) -> None:
|
||||
raise NotImplementedError
|
||||
|
||||
def newpad(self, height: int, width: int) -> Union[FakePad, Any]:
|
||||
if self.screen:
|
||||
return curses.newpad(height, width)
|
||||
else:
|
||||
return FakePad()
|
||||
|
Reference in New Issue
Block a user