summaryrefslogtreecommitdiff
path: root/test/test_ui
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2019-09-29 18:12:48 +0200
committermathieui <mathieui@mathieui.net>2020-05-09 19:46:17 +0200
commita5e92800477f6195a6b2e8c6e64a56859117d5b8 (patch)
treef53550024091a12deeee88c0d9897d0aeba9f4bf /test/test_ui
parentfefbb0b08887b761ad7a1cf95cf6b9f5f30013a6 (diff)
downloadpoezio-a5e92800477f6195a6b2e8c6e64a56859117d5b8.tar.gz
poezio-a5e92800477f6195a6b2e8c6e64a56859117d5b8.tar.bz2
poezio-a5e92800477f6195a6b2e8c6e64a56859117d5b8.tar.xz
poezio-a5e92800477f6195a6b2e8c6e64a56859117d5b8.zip
Pass a message to add_message instead of messed up kwargs everywhere
Changes LOTS of things
Diffstat (limited to 'test/test_ui')
-rw-r--r--test/test_ui/test_render.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/test/test_ui/test_render.py b/test/test_ui/test_render.py
index d13751d1..57bd05c9 100644
--- a/test/test_ui/test_render.py
+++ b/test/test_ui/test_render.py
@@ -4,7 +4,7 @@ from datetime import datetime
from poezio.theming import get_theme
from poezio.ui.render import build_lines, Line, write_pre
from poezio.ui.consts import SHORT_FORMAT
-from poezio.ui.types import BaseMessage, Message, XMLLog
+from poezio.ui.types import BaseMessage, Message, StatusMessage, XMLLog
def test_simple_build_basemsg():
msg = BaseMessage(txt='coucou')
@@ -28,6 +28,17 @@ def test_simple_render_separator():
line = build_lines(None, 100, True, 10)[0]
assert line is None
+
+def test_simple_render_status():
+ class Obj:
+ name = 'toto'
+ msg = StatusMessage("Coucou {name}", {'name': lambda: Obj.name})
+ assert msg.txt == "Coucou toto"
+ Obj.name = 'titi'
+ build_lines(msg, 100, True, 10)[0]
+ assert msg.txt == "Coucou titi"
+
+
class FakeBuffer:
def __init__(self):
self.text = ''