@@ -73,54 +73,18 @@ def test_browser_hack(self):
7373
7474 def test_missing_semicolon (self ):
7575 for entity , result in (
76- (
77- "<<!" ,
78- "<<!" ,
79- ),
80- (
81- "<!" ,
82- "<!" ,
83- ),
84- (
85- "A " ,
86- "A " ,
87- ),
88- (
89- "A!" ,
90- "A!" ,
91- ),
92- (
93- "Ah" ,
94- "Ah" ,
95- ),
96- (
97- "A!" ,
98- "A!" ,
99- ),
100- (
101- "Ax" ,
102- "Ax" ,
103- ),
104- (
105- "³!" ,
106- "\u00B3 !" ,
107- ),
108- (
109- "Á!" ,
110- "\u00C1 !" ,
111- ),
112- (
113- "☃!" ,
114- "\u2603 !" ,
115- ),
116- (
117- "™" ,
118- "\u2122 " ,
119- ),
120- (
121- "™" ,
122- "\u2122 " ,
123- ),
76+ ("<<!" , "<<!" ),
77+ ("<!" , "<!" ),
78+ ("A " , "A " ),
79+ ("A!" , "A!" ),
80+ ("Ah" , "Ah" ),
81+ ("A!" , "A!" ),
82+ ("Ax" , "Ax" ),
83+ ("³!" , "\u00B3 !" ),
84+ ("Á!" , "\u00C1 !" ),
85+ ("☃!" , "\u2603 !" ),
86+ ("™" , "\u2122 " ),
87+ ("™" , "\u2122 " ),
12488 ):
12589 self .assertEqual (replace_entities (entity , encoding = "cp1252" ), result )
12690 self .assertEqual (
@@ -203,16 +167,7 @@ def test_returns_unicode(self):
203167 def test_remove_tags_without_tags (self ):
204168 # text without tags
205169 self .assertEqual (remove_tags ("no tags" ), "no tags" )
206- self .assertEqual (
207- remove_tags (
208- "no tags" ,
209- which_ones = (
210- "p" ,
211- "b" ,
212- ),
213- ),
214- "no tags" ,
215- )
170+ self .assertEqual (remove_tags ("no tags" , which_ones = ("p" , "b" )), "no tags" )
216171
217172 def test_remove_tags (self ):
218173 # text with tags
@@ -294,14 +249,7 @@ def test_without_tags(self):
294249 # text without tags
295250 self .assertEqual (remove_tags_with_content ("no tags" ), "no tags" )
296251 self .assertEqual (
297- remove_tags_with_content (
298- "no tags" ,
299- which_ones = (
300- "p" ,
301- "b" ,
302- ),
303- ),
304- "no tags" ,
252+ remove_tags_with_content ("no tags" , which_ones = ("p" , "b" )), "no tags"
305253 )
306254
307255 def test_with_tags (self ):
@@ -340,28 +288,10 @@ def test_returns_unicode(self):
340288 assert isinstance (replace_escape_chars (b"no ec" ), str )
341289 assert isinstance (replace_escape_chars (b"no ec" , replace_by = "str" ), str )
342290 assert isinstance (replace_escape_chars (b"no ec" , replace_by = "str" ), str )
343- assert isinstance (
344- replace_escape_chars (
345- b"no ec" ,
346- which_ones = (
347- "\n " ,
348- "\t " ,
349- ),
350- ),
351- str ,
352- )
291+ assert isinstance (replace_escape_chars (b"no ec" , which_ones = ("\n " , "\t " )), str )
353292 assert isinstance (replace_escape_chars ("no ec" ), str )
354293 assert isinstance (replace_escape_chars ("no ec" , replace_by = "str" ), str )
355- assert isinstance (
356- replace_escape_chars (
357- "no ec" ,
358- which_ones = (
359- "\n " ,
360- "\t " ,
361- ),
362- ),
363- str ,
364- )
294+ assert isinstance (replace_escape_chars ("no ec" , which_ones = ("\n " , "\t " )), str )
365295
366296 def test_without_escape_chars (self ):
367297 # text without escape chars
@@ -669,3 +599,14 @@ def test_inside_script(self):
669599 get_meta_refresh (body , baseurl , ignore_tags = ()),
670600 (0.0 , "http://example.org/foobar_required" ),
671601 )
602+
603+ def test_redirections_in_different_ordering__in_meta_tag (self ):
604+ baseurl = "http://localhost:8000"
605+ url1 = '<html><head><meta http-equiv="refresh" content="0;url=dummy.html"></head></html>'
606+ url2 = '<html><head><meta content="0;url=dummy.html" http-equiv="refresh"></head></html>'
607+ self .assertEqual (
608+ get_meta_refresh (url1 , baseurl ), (0.0 , "http://localhost:8000/dummy.html" )
609+ )
610+ self .assertEqual (
611+ get_meta_refresh (url2 , baseurl ), (0.0 , "http://localhost:8000/dummy.html" )
612+ )
0 commit comments