Use proper separators on windows

This commit is contained in:
Kovid Goyal 2020-01-08 22:08:08 +05:30
parent f0e6ead4c7
commit 5784d989f5
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -6,7 +6,7 @@ from __future__ import absolute_import, division, print_function, unicode_litera
from lxml import etree
# resolving of SYSTEM entitties is turned off as entities can cause
# resolving of SYSTEM entities is turned off as entities can cause
# reads of local files, for example:
# <!DOCTYPE foo [ <!ENTITY passwd SYSTEM "file:///etc/passwd" >]>
@ -44,7 +44,7 @@ def find_tests():
def test_safe_xml_fromstring(self):
templ = '''<!DOCTYPE foo [ <!ENTITY e {id} "{val}" > ]><r>&e;</r>'''
external = 'file:///' + self.temp_file
external = 'file:///' + self.temp_file.replace(os.sep, '/')
self.assertEqual(etree.fromstring(templ.format(id='SYSTEM', val=external)).text, 'external')
for eid, val, expected in (
('', 'normal entity', 'normal entity'),