style and tools test fix

This commit is contained in:
Will McGugan 2019-12-24 12:56:38 +00:00
parent 5861c21cf7
commit 2262069eef
2 changed files with 10 additions and 0 deletions

View File

@ -114,6 +114,15 @@ def test_add():
assert Style().__add__("foo") == NotImplemented
def test_iadd():
style = Style(color="red")
style += Style(bold=True)
assert style == Style(color="red", bold=True)
style += None
assert style == Style(color="red", bold=True)
assert style.__iadd__("foo") == NotImplemented
def test_style_stack():
stack = StyleStack(Style(color="red"))
repr(stack)

View File

@ -34,3 +34,4 @@ def test_ratio_divide():
assert ratio_divide(12, [1, 3]) == [3, 9]
assert ratio_divide(0, [1, 3]) == [0, 0]
assert ratio_divide(0, [1, 3], [1, 1]) == [1, 1]
assert ratio_divide(10, [1, 0]) == [10, 0]