Download testbed/Textualize__textual/tests/layouts/test_common_layout_features.py from hc99/FEA-Bench: direct link, hf CLI and curl.
- Browser
- Download file 859 Bytes
-
https://huggingface.co/datasets/hc99/FEA-Bench/resolve/main/testbed/Textualize__textual/tests/layouts/test_common_layout_features.py
- Command line
-
hf download hf://datasets/hc99/FEA-Bench/testbed/Textualize__textual/tests/layouts/test_common_layout_features.py
-
curl -L -o test_common_layout_features.py https://huggingface.co/datasets/hc99/FEA-Bench/resolve/main/testbed/Textualize__textual/tests/layouts/test_common_layout_features.py
859 Bytes
| import pytest | |
| from textual.screen import Screen | |
| from textual.widget import Widget | |
| def test_nodes_take_display_property_into_account_when_they_display_their_children( | |
| layout: str, display: str, expected_in_displayed_children: bool | |
| ): | |
| widget = Widget(name="widget that might not be visible 🥷 ") | |
| widget.styles.display = display | |
| screen = Screen() | |
| screen.styles.layout = layout | |
| screen._add_child(widget) | |
| displayed_children = screen.displayed_children | |
| assert isinstance(displayed_children, list) | |
| assert (widget in screen.displayed_children) is expected_in_displayed_children | |