MCPcopy
hub / github.com/scrapy/scrapy / test_xmliter_encoding

Method test_xmliter_encoding

tests/test_utils_iterators.py:245–256  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

243 next(i)
244
245 def test_xmliter_encoding(self):
246 body = (
247 b'<?xml version="1.0" encoding="ISO-8859-9"?>\n'
248 b"<xml>\n"
249 b" <item>Some Turkish Characters \xd6\xc7\xde\xdd\xd0\xdc \xfc\xf0\xfd\xfe\xe7\xf6</item>\n"
250 b"</xml>\n\n"
251 )
252 response = XmlResponse("http://www.example.com", body=body)
253 assert (
254 next(self.xmliter(response, "item")).get()
255 == "<item>Some Turkish Characters \xd6\xc7\u015e\u0130\u011e\xdc \xfc\u011f\u0131\u015f\xe7\xf6</item>"
256 )
257
258
259@pytest.mark.filterwarnings("ignore::scrapy.exceptions.ScrapyDeprecationWarning")

Callers

nothing calls this directly

Calls 3

xmliterMethod · 0.95
XmlResponseClass · 0.90
getMethod · 0.45

Tested by

no test coverage detected