Fix test_format_xml with dot in path
When the path contains dot ".", replacing all dots will generate a non-exist result and raises a FileNotFoundError. Replacing only the last dot fixes this.
This commit is contained in:
parent
b275257553
commit
b352557092
|
@ -23,7 +23,7 @@ def test_format_xml(filename):
|
||||||
path = data.path(filename)
|
path = data.path(filename)
|
||||||
with open(path) as f:
|
with open(path) as f:
|
||||||
input = f.read()
|
input = f.read()
|
||||||
with open(path.replace(".", "-formatted.")) as f:
|
with open("-formatted.".join(path.rsplit(".", 1))) as f:
|
||||||
expected = f.read()
|
expected = f.read()
|
||||||
tokens = xml_html.tokenize(input)
|
tokens = xml_html.tokenize(input)
|
||||||
assert xml_html.format_xml(tokens) == expected
|
assert xml_html.format_xml(tokens) == expected
|
||||||
|
|
Loading…
Reference in New Issue