File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -229,3 +229,25 @@ def test_from_meta():
229229def 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
You can’t perform that action at this time.
0 commit comments