From 122c0f02577a5b2ad8714a4d742a58e28ef03a07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Fri, 14 Jun 2024 21:03:29 +0200 Subject: [PATCH] Remove unnecessary test case --- tests/test_selector.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/tests/test_selector.py b/tests/test_selector.py index 8cb2a1b..db8d099 100644 --- a/tests/test_selector.py +++ b/tests/test_selector.py @@ -1007,20 +1007,7 @@ def test_remove_selector(self) -> None: self.assertIsSelectorList(sel.css("li")) self.assertEqual(sel.css("li::text").getall(), ["2", "3"]) - def test_remove_selector_from_html_in_text(self) -> None: - html = ( - "

hello world

" - ) - expect_result = "

hello world

" - sel = self.sscls(text=html, type="html") - self.assertEqual(sel.type, "html") - li_sel_list = sel.css("style") - li_sel_list.drop() - self.assertEqual(sel.get(), expect_result) - # The type of the parent selector should not change - self.assertEqual(sel.type, "html") - - def test_remove_selector_from_html_in_json(self) -> None: + def test_remove_selector_from_nested_html(self) -> None: json_str = """{ "title": "hello world", "body": "

hello world

" @@ -1028,6 +1015,8 @@ def test_remove_selector_from_html_in_json(self) -> None: """ expect_result = "

hello world

" sel = self.sscls(text=json_str) + # We need to force the selector type to HTML to make that functionality + # readily available. html_sel = sel.jmespath("body", type="html")[0] self.assertEqual(html_sel.type, "html") li_sel_list = html_sel.css("style")