1616 _get_html_media_encodings ,
1717 decode_body ,
1818 parse_html_to_open_graph ,
19- rebase_url ,
2019 summarize_paragraphs ,
2120)
2221
@@ -161,7 +160,7 @@ def test_simple(self) -> None:
161160 """
162161
163162 tree = decode_body (html , "http://example.com/test.html" )
164- og = parse_html_to_open_graph (tree , "http://example.com/test.html" )
163+ og = parse_html_to_open_graph (tree )
165164
166165 self .assertEqual (og , {"og:title" : "Foo" , "og:description" : "Some text." })
167166
@@ -177,7 +176,7 @@ def test_comment(self) -> None:
177176 """
178177
179178 tree = decode_body (html , "http://example.com/test.html" )
180- og = parse_html_to_open_graph (tree , "http://example.com/test.html" )
179+ og = parse_html_to_open_graph (tree )
181180
182181 self .assertEqual (og , {"og:title" : "Foo" , "og:description" : "Some text." })
183182
@@ -196,7 +195,7 @@ def test_comment2(self) -> None:
196195 """
197196
198197 tree = decode_body (html , "http://example.com/test.html" )
199- og = parse_html_to_open_graph (tree , "http://example.com/test.html" )
198+ og = parse_html_to_open_graph (tree )
200199
201200 self .assertEqual (
202201 og ,
@@ -218,7 +217,7 @@ def test_script(self) -> None:
218217 """
219218
220219 tree = decode_body (html , "http://example.com/test.html" )
221- og = parse_html_to_open_graph (tree , "http://example.com/test.html" )
220+ og = parse_html_to_open_graph (tree )
222221
223222 self .assertEqual (og , {"og:title" : "Foo" , "og:description" : "Some text." })
224223
@@ -232,7 +231,7 @@ def test_missing_title(self) -> None:
232231 """
233232
234233 tree = decode_body (html , "http://example.com/test.html" )
235- og = parse_html_to_open_graph (tree , "http://example.com/test.html" )
234+ og = parse_html_to_open_graph (tree )
236235
237236 self .assertEqual (og , {"og:title" : None , "og:description" : "Some text." })
238237
@@ -247,7 +246,7 @@ def test_h1_as_title(self) -> None:
247246 """
248247
249248 tree = decode_body (html , "http://example.com/test.html" )
250- og = parse_html_to_open_graph (tree , "http://example.com/test.html" )
249+ og = parse_html_to_open_graph (tree )
251250
252251 self .assertEqual (og , {"og:title" : "Title" , "og:description" : "Some text." })
253252
@@ -262,7 +261,7 @@ def test_missing_title_and_broken_h1(self) -> None:
262261 """
263262
264263 tree = decode_body (html , "http://example.com/test.html" )
265- og = parse_html_to_open_graph (tree , "http://example.com/test.html" )
264+ og = parse_html_to_open_graph (tree )
266265
267266 self .assertEqual (og , {"og:title" : None , "og:description" : "Some text." })
268267
@@ -290,7 +289,7 @@ def test_xml(self) -> None:
290289 <head><title>Foo</title></head><body>Some text.</body></html>
291290 """ .strip ()
292291 tree = decode_body (html , "http://example.com/test.html" )
293- og = parse_html_to_open_graph (tree , "http://example.com/test.html" )
292+ og = parse_html_to_open_graph (tree )
294293 self .assertEqual (og , {"og:title" : "Foo" , "og:description" : "Some text." })
295294
296295 def test_invalid_encoding (self ) -> None :
@@ -304,7 +303,7 @@ def test_invalid_encoding(self) -> None:
304303 </html>
305304 """
306305 tree = decode_body (html , "http://example.com/test.html" , "invalid-encoding" )
307- og = parse_html_to_open_graph (tree , "http://example.com/test.html" )
306+ og = parse_html_to_open_graph (tree )
308307 self .assertEqual (og , {"og:title" : "Foo" , "og:description" : "Some text." })
309308
310309 def test_invalid_encoding2 (self ) -> None :
@@ -319,7 +318,7 @@ def test_invalid_encoding2(self) -> None:
319318 </html>
320319 """
321320 tree = decode_body (html , "http://example.com/test.html" )
322- og = parse_html_to_open_graph (tree , "http://example.com/test.html" )
321+ og = parse_html_to_open_graph (tree )
323322 self .assertEqual (og , {"og:title" : "ÿÿ Foo" , "og:description" : "Some text." })
324323
325324 def test_windows_1252 (self ) -> None :
@@ -333,7 +332,7 @@ def test_windows_1252(self) -> None:
333332 </html>
334333 """
335334 tree = decode_body (html , "http://example.com/test.html" )
336- og = parse_html_to_open_graph (tree , "http://example.com/test.html" )
335+ og = parse_html_to_open_graph (tree )
337336 self .assertEqual (og , {"og:title" : "ó" , "og:description" : "Some text." })
338337
339338
@@ -448,34 +447,3 @@ def test_unknown_invalid(self) -> None:
448447 'text/html; charset="invalid"' ,
449448 )
450449 self .assertEqual (list (encodings ), ["utf-8" , "cp1252" ])
451-
452-
453- class RebaseUrlTestCase (unittest .TestCase ):
454- def test_relative (self ) -> None :
455- """Relative URLs should be resolved based on the context of the base URL."""
456- self .assertEqual (
457- rebase_url ("subpage" , "https://example.com/foo/" ),
458- "https://example.com/foo/subpage" ,
459- )
460- self .assertEqual (
461- rebase_url ("sibling" , "https://example.com/foo" ),
462- "https://example.com/sibling" ,
463- )
464- self .assertEqual (
465- rebase_url ("/bar" , "https://example.com/foo/" ),
466- "https://example.com/bar" ,
467- )
468-
469- def test_absolute (self ) -> None :
470- """Absolute URLs should not be modified."""
471- self .assertEqual (
472- rebase_url ("https://alice.com/a/" , "https://example.com/foo/" ),
473- "https://alice.com/a/" ,
474- )
475-
476- def test_data (self ) -> None :
477- """Data URLs should not be modified."""
478- self .assertEqual (
479- rebase_url ("data:,Hello%2C%20World%21" , "https://example.com/foo/" ),
480- "data:,Hello%2C%20World%21" ,
481- )
0 commit comments