Skip to content

Commit 635ca9d

Browse files
committed
test for new method
1 parent b26868a commit 635ca9d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

tests/test_style.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,3 +229,25 @@ def test_from_meta():
229229
def test_on():
230230
style = Style.on({"foo": "bar"}, click="CLICK") + Style(color="red")
231231
assert style.meta == {"foo": "bar", "@click": "CLICK"}
232+
233+
234+
def test_clear_meta_and_links():
235+
style = Style.parse("bold red on black link https://example.org") + Style.on(
236+
click="CLICK"
237+
)
238+
239+
assert style.meta == {"@click": "CLICK"}
240+
assert style.link == "https://example.org"
241+
assert style.color == Color.parse("red")
242+
assert style.bgcolor == Color.parse("black")
243+
assert style.bold
244+
assert not style.italic
245+
246+
clear_style = style.clear_meta_and_links()
247+
248+
assert clear_style.meta == {}
249+
assert clear_style.link == None
250+
assert clear_style.color == Color.parse("red")
251+
assert clear_style.bgcolor == Color.parse("black")
252+
assert clear_style.bold
253+
assert not clear_style.italic

0 commit comments

Comments
 (0)