mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Complete coverage of arrangement doc options
While the code in _arrange.py does mark the unknown dock type branch as being for the benefit of type checkers only, and was marked as to be ignored for the purposes of coverage, it was still showing in a coverage test and it's not a terrible thing to ensure that a user, giving the wrong type of dock in their own code, will get the expected result.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
import pytest
|
||||
|
||||
from textual._arrange import arrange, TOP_Z
|
||||
from textual._layout import WidgetPlacement
|
||||
from textual.geometry import Region, Size, Spacing
|
||||
@@ -91,3 +93,9 @@ def test_arrange_dock_bottom():
|
||||
]
|
||||
assert widgets == {child, header}
|
||||
assert spacing == Spacing(0, 0, 1, 0)
|
||||
|
||||
def test_arrange_dock_badly():
|
||||
child = Widget(id="child")
|
||||
child.styles.dock = "nowhere"
|
||||
with pytest.raises(AssertionError):
|
||||
_ = arrange( Widget(), [child], Size(80, 24), Size(80, 24))
|
||||
|
||||
Reference in New Issue
Block a user