Scrapy, a fast high-level web crawling & scraping framework for Python.
PY3 fix test_utils_sitemap.
Mikhail Korobov560c32d330e5
diff --git a/tests/py3-ignores.txt b/tests/py3-ignores.txtindex 7919f65f1..d1831c266 100644--- a/tests/py3-ignores.txt+++ b/tests/py3-ignores.txt@@ -69,7 +69,6 @@ tests/test_utils_request.pytests/test_utils_response.pytests/test_utils_serialize.pytests/test_utils_signal.py-tests/test_utils_sitemap.pytests/test_utils_spider.pytests/test_utils_template.pytests/test_utils_url.pydiff --git a/tests/test_utils_sitemap.py b/tests/test_utils_sitemap.pyindex 56585143f..bd2677956 100644--- a/tests/test_utils_sitemap.py+++ b/tests/test_utils_sitemap.py@@ -5,7 +5,7 @@ from scrapy.utils.sitemap import Sitemap, sitemap_urls_from_robotsclass SitemapTest(unittest.TestCase):def test_sitemap(self):- s = Sitemap("""<?xml version="1.0" encoding="UTF-8"?>+ s = Sitemap(b"""<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.google.com/schemas/sitemap/0.84"><url><loc>http://www.example.com/</loc>@@ -25,7 +25,7 @@ class SitemapTest(unittest.TestCase):[{'priority': '1', 'loc': 'http://www.example.com/', 'lastmod': '2009-08-16', 'changefreq': 'daily'}, {'priority': '0.8', 'loc': 'http://www.example.com/Special-Offers.html', 'lastmod': '2009-08-16', 'changefreq': 'weekly'}])def test_sitemap_index(self):- s = Sitemap("""<?xml version="1.0" encoding="UTF-8"?>+ s = Sitemap(b"""<?xml version="1.0" encoding="UTF-8"?><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><sitemap><loc>http://www.example.com/sitemap1.xml.gz</loc>@@ -43,7 +43,7 @@ class SitemapTest(unittest.TestCase):"""Assert we can deal with trailing spaces inside <loc> tags - we'veseen those"""- s = Sitemap("""<?xml version="1.0" encoding="UTF-8"?>+ s = Sitemap(b"""<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.google.com/schemas/sitemap/0.84"><url><loc> http://www.example.com/</loc>@@ -65,7 +65,7 @@ class SitemapTest(unittest.TestCase):def test_sitemap_wrong_ns(self):"""We have seen sitemaps with wrongs ns. Presumably, Google still workswith these, though is not 100% confirmed"""- s = Sitemap("""<?xml version="1.0" encoding="UTF-8"?>+ s = Sitemap(b"""<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.google.com/schemas/sitemap/0.84"><url xmlns=""><loc> http://www.example.com/</loc>@@ -87,7 +87,7 @@ class SitemapTest(unittest.TestCase):def test_sitemap_wrong_ns2(self):"""We have seen sitemaps with wrongs ns. Presumably, Google still workswith these, though is not 100% confirmed"""- s = Sitemap("""<?xml version="1.0" encoding="UTF-8"?>+ s = Sitemap(b"""<?xml version="1.0" encoding="UTF-8"?><urlset><url xmlns=""><loc> http://www.example.com/</loc>@@ -129,7 +129,7 @@ Disallow: /forum/active/def test_sitemap_blanklines(self):"""Assert we can deal with starting blank lines before <xml> tag"""- s = Sitemap("""\+ s = Sitemap(b"""\<?xml version="1.0" encoding="UTF-8"?><sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">@@ -160,7 +160,7 @@ Disallow: /forum/active/])def test_comment(self):- s = Sitemap("""<?xml version="1.0" encoding="UTF-8"?>+ s = Sitemap(b"""<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"xmlns:xhtml="http://www.w3.org/1999/xhtml"><url>@@ -174,7 +174,7 @@ Disallow: /forum/active/])def test_alternate(self):- s = Sitemap("""<?xml version="1.0" encoding="UTF-8"?>+ s = Sitemap(b"""<?xml version="1.0" encoding="UTF-8"?><urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"xmlns:xhtml="http://www.w3.org/1999/xhtml"><url>@@ -196,7 +196,7 @@ Disallow: /forum/active/])def test_xml_entity_expansion(self):- s = Sitemap("""<?xml version="1.0" encoding="utf-8"?>+ s = Sitemap(b"""<?xml version="1.0" encoding="utf-8"?><!DOCTYPE foo [<!ELEMENT foo ANY ><!ENTITY xxe SYSTEM "file:///etc/passwd" >