diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-04-06 18:18:01 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-04-06 18:18:01 +0300 |
commit | 01fbacb386809436dfa331780875aed72cb76118 (patch) | |
tree | 04c911ad96ff0523bd4d3e7a45c23cf2f2d7607d /contrib/python/prompt-toolkit/py3/tests/test_shortcuts.py | |
parent | 48fb997d7f820a474b9094a72d9798a95ec612b7 (diff) | |
download | ydb-01fbacb386809436dfa331780875aed72cb76118.tar.gz |
intermediate changes
ref:b4f892f3c2b06a356c155f73c27efc5661a7fb89
Diffstat (limited to 'contrib/python/prompt-toolkit/py3/tests/test_shortcuts.py')
-rw-r--r-- | contrib/python/prompt-toolkit/py3/tests/test_shortcuts.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/contrib/python/prompt-toolkit/py3/tests/test_shortcuts.py b/contrib/python/prompt-toolkit/py3/tests/test_shortcuts.py index dc4d65b272..10ee73a20e 100644 --- a/contrib/python/prompt-toolkit/py3/tests/test_shortcuts.py +++ b/contrib/python/prompt-toolkit/py3/tests/test_shortcuts.py @@ -1,4 +1,7 @@ +from prompt_toolkit.shortcuts import print_container from prompt_toolkit.shortcuts.prompt import _split_multiline_prompt +from prompt_toolkit.shortcuts.utils import print_container +from prompt_toolkit.widgets import Frame, TextArea def test_split_multiline_prompt(): @@ -49,3 +52,16 @@ def test_split_multiline_prompt(): assert has_before_tokens() is True assert before() == [("class:testclass", "\n")] assert first_input_line() == [("class:testclass", "a"), ("class:testclass", "b")] + + +def test_print_container(tmpdir): + # Call `print_container`, render to a dummy file. + f = tmpdir.join("output") + with open(f, "w") as fd: + print_container(Frame(TextArea(text="Hello world!\n"), title="Title"), file=fd) + + # Verify rendered output. + with open(f, "r") as fd: + text = fd.read() + assert "Hello world" in text + assert "Title" in text |