Skip to content

Commit

Permalink
πŸ“„ Fix shit
Browse files Browse the repository at this point in the history
  • Loading branch information
asim-shrestha committed Aug 11, 2024
1 parent 85269b6 commit 052da7a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
7 changes: 6 additions & 1 deletion tests/test_elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@
@pytest.mark.parametrize(
"html_file, expected_tag_to_xpath, expected_page_text, expected_tag_string",
[
("mock_html/text_only.html", {0: "//html/body/h1/text()"}, ["Hello, World!"], ["[ 0 ]"]),
(
"mock_html/text_only.html",
{0: "//html/body/h1/text()"},
["Hello, World!"],
["[ 0 ]"],
),
(
"mock_html/hyperlink_only.html",
{0: '//html/body/p/a[@id="link1"]'},
Expand Down
7 changes: 3 additions & 4 deletions tests/test_namespace.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ async def test_xpath_namespace(tarsier, async_page):

_, tag_to_xpath = await tarsier.page_to_text(async_page, tag_text_elements=True)
assert len(tag_to_xpath) == 1, "The page contains only a single tag"
assert tag_to_xpath[0] == '//html/body/*[name()="sc:visitoridentification"]/div/text()', (
f"Namespaces within the xpath were not correctly handled "
f"Got: {tag_to_xpath}"
)
assert (
tag_to_xpath[0] == '//html/body/*[name()="sc:visitoridentification"]/div/text()'
), f"Namespaces within the xpath were not correctly handled " f"Got: {tag_to_xpath}"

0 comments on commit 052da7a

Please sign in to comment.