diff --git a/tests/test_style.py b/tests/test_style.py index bf02af83..b5c01729 100644 --- a/tests/test_style.py +++ b/tests/test_style.py @@ -229,3 +229,25 @@ def test_from_meta(): def test_on(): style = Style.on({"foo": "bar"}, click="CLICK") + Style(color="red") assert style.meta == {"foo": "bar", "@click": "CLICK"} + + +def test_clear_meta_and_links(): + style = Style.parse("bold red on black link https://example.org") + Style.on( + click="CLICK" + ) + + assert style.meta == {"@click": "CLICK"} + assert style.link == "https://example.org" + assert style.color == Color.parse("red") + assert style.bgcolor == Color.parse("black") + assert style.bold + assert not style.italic + + clear_style = style.clear_meta_and_links() + + assert clear_style.meta == {} + assert clear_style.link == None + assert clear_style.color == Color.parse("red") + assert clear_style.bgcolor == Color.parse("black") + assert clear_style.bold + assert not clear_style.italic