From 2262069eef922005dfe43e33a70e7b8162129298 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Tue, 24 Dec 2019 12:56:38 +0000 Subject: [PATCH] style and tools test fix --- tests/test_style.py | 9 +++++++++ tests/test_tools.py | 1 + 2 files changed, 10 insertions(+) diff --git a/tests/test_style.py b/tests/test_style.py index e1564050..e85ffcd4 100644 --- a/tests/test_style.py +++ b/tests/test_style.py @@ -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) diff --git a/tests/test_tools.py b/tests/test_tools.py index d860ea76..ba6bb810 100644 --- a/tests/test_tools.py +++ b/tests/test_tools.py @@ -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]