@@ -13,7 +13,7 @@ class XmliterTestCase(unittest.TestCase):
13
13
xmliter = staticmethod (xmliter )
14
14
15
15
def test_xmliter (self ):
16
- body = """<?xml version="1.0" encoding="UTF-8"?>\
16
+ body = b """<?xml version="1.0" encoding="UTF-8"?>\
17
17
<products xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="someschmea.xsd">\
18
18
<product id="001">\
19
19
<type>Type 1</type>\
@@ -40,7 +40,7 @@ def test_xmliter_text(self):
40
40
[[u'one' ], [u'two' ]])
41
41
42
42
def test_xmliter_namespaces (self ):
43
- body = """\
43
+ body = b """\
44
44
<?xml version="1.0" encoding="UTF-8"?>
45
45
<rss version="2.0" xmlns:g="http://base.google.com/ns/1.0">
46
46
<channel>
@@ -83,7 +83,7 @@ def test_xmliter_exception(self):
83
83
self .assertRaises (StopIteration , next , iter )
84
84
85
85
def test_xmliter_encoding (self ):
86
- body = '<?xml version="1.0" encoding="ISO-8859-9"?>\n <xml>\n <item>Some Turkish Characters \xd6 \xc7 \xde \xdd \xd0 \xdc \xfc \xf0 \xfd \xfe \xe7 \xf6 </item>\n </xml>\n \n '
86
+ body = b '<?xml version="1.0" encoding="ISO-8859-9"?>\n <xml>\n <item>Some Turkish Characters \xd6 \xc7 \xde \xdd \xd0 \xdc \xfc \xf0 \xfd \xfe \xe7 \xf6 </item>\n </xml>\n \n '
87
87
response = XmlResponse ('http://www.example.com' , body = body )
88
88
self .assertEqual (
89
89
self .xmliter (response , 'item' ).next ().extract (),
@@ -95,7 +95,7 @@ class LxmlXmliterTestCase(XmliterTestCase):
95
95
xmliter = staticmethod (xmliter_lxml )
96
96
97
97
def test_xmliter_iterate_namespace (self ):
98
- body = """\
98
+ body = b """\
99
99
<?xml version="1.0" encoding="UTF-8"?>
100
100
<rss version="2.0" xmlns="http://base.google.com/ns/1.0">
101
101
<channel>
@@ -124,7 +124,7 @@ def test_xmliter_iterate_namespace(self):
124
124
self .assertEqual (node .xpath ('text()' ).extract (), ['http://www.mydummycompany.com/images/item2.jpg' ])
125
125
126
126
def test_xmliter_namespaces_prefix (self ):
127
- body = """\
127
+ body = b """\
128
128
<?xml version="1.0" encoding="UTF-8"?>
129
129
<root>
130
130
<h:table xmlns:h="http://www.w3.org/TR/html4/">
0 commit comments