Skip to content

Commit

Permalink
Add forgotten test helper
Browse files Browse the repository at this point in the history
  • Loading branch information
dragon-dxw committed Sep 12, 2023
1 parent e0ae338 commit 43aed52
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/client_helpers/test_xml_helpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import lxml.etree

from caselawclient.xml_helpers import get_xpath_match_string, get_xpath_match_strings


def test_xpath_single():
node = lxml.etree.fromstring("<root><cat>1</cat><cat>2</cat></root>")
path = "//cat/text()"
assert get_xpath_match_string(node, path) == "1"


def test_xpath_multiple():
node = lxml.etree.fromstring("<root><cat>1</cat><cat>2</cat></root>")
path = "//cat/text()"
assert get_xpath_match_strings(node, path) == ["1", "2"]

0 comments on commit 43aed52

Please sign in to comment.