Use a fake pad to make tests runnable

This commit is contained in:
Yohann D'ANELLO
2020-11-08 23:40:03 +01:00
parent 65d89b7f9f
commit 3486c865a1
5 changed files with 27 additions and 5 deletions

View File

@ -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()