Skip to content
Permalink
Browse files

test xml nodename with dots

  • Loading branch information
Digenis authored and dangra committed Dec 30, 2015
1 parent a55078c commit 4418fc3b862fd0b23062be70ae6e07fcf34ea4b1
Showing with 13 additions and 0 deletions.
  1. +13 −0 tests/test_utils_iterators.py
@@ -33,6 +33,19 @@ def test_xmliter(self):
self.assertEqual(attrs,
[(['001'], ['Name 1'], ['Type 1']), (['002'], ['Name 2'], ['Type 2'])])

def test_xmliter_unusual_node(self):
body = b"""<?xml version="1.0" encoding="UTF-8"?>
<root>
<matchme...></matchme...>
<matchmenot></matchmenot>
</root>
"""
response = XmlResponse(url="http://example.com", body=body)
nodenames = [e.xpath('name()').extract()
for e in self.xmliter(response, 'matchme...')]
self.assertEqual(nodenames, [['matchme...']])


def test_xmliter_text(self):
body = u"""<?xml version="1.0" encoding="UTF-8"?><products><product>one</product><product>two</product></products>"""

0 comments on commit 4418fc3

Please sign in to comment.
You can’t perform that action at this time.