Spacing tests

This commit is contained in:
Darren Burns
2022-04-27 11:59:09 +01:00
parent 65070195c2
commit 6b2533fb65
3 changed files with 9 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
#uber1 { #uber1 {
layout: vertical; layout: vertical;
background: dark_green; background: dark_green;
overflow: hidden auto; overflow-x: x;
border: heavy white; border: heavy white;
} }

View File

@@ -7,11 +7,11 @@ import rich.repr
from ._error_tools import friendly_list from ._error_tools import friendly_list
from ._help_renderables import HelpText from ._help_renderables import HelpText
from ._help_text import ( from ._help_text import (
spacing_invalid_value,
spacing_wrong_number_of_values, spacing_wrong_number_of_values,
scalar_help_text, scalar_help_text,
spacing_invalid_value,
string_enum_help_text,
color_property_help_text, color_property_help_text,
string_enum_help_text,
border_property_help_text, border_property_help_text,
layout_property_help_text, layout_property_help_text,
docks_property_help_text, docks_property_help_text,

View File

@@ -324,6 +324,12 @@ def test_spacing_sub():
Spacing(1, 2, 3, 4) - "foo" Spacing(1, 2, 3, 4) - "foo"
def test_spacing_convenience_constructors():
assert Spacing.vertical(2) == Spacing(2, 0, 2, 0)
assert Spacing.horizontal(2) == Spacing(0, 2, 0, 2)
assert Spacing.all(2) == Spacing(2, 2, 2, 2)
def test_split(): def test_split():
assert Region(10, 5, 22, 15).split(10, 5) == ( assert Region(10, 5, 22, 15).split(10, 5) == (
Region(10, 5, 10, 5), Region(10, 5, 10, 5),