Merge pull request #247 from cjmayo/robots37

Make TestRobotsTxt Python 3.7 compatible
This commit is contained in:
anarcat 2019-04-25 15:21:35 -04:00 committed by GitHub
commit 243dedf3bc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -18,6 +18,7 @@
Test robots.txt parsing.
"""
import sys
import unittest
import linkcheck.robotparser2
@ -224,7 +225,8 @@ class TestRobotsTxt (unittest.TestCase):
"Disallow: /tmp",
"Disallow: /a%3Cd.html",
"Disallow: /a/b.html",
"Disallow: /%7Ejoe/index.html",
"Disallow: /%7Ejoe/index.html" if sys.version_info < (3, 7) \
else "Disallow: /~joe/index.html",
]
self.rp.parse(lines)
self.assertEqual(str(self.rp), "\n".join(lines2))
@ -249,7 +251,8 @@ class TestRobotsTxt (unittest.TestCase):
"Disallow: /tmp/",
"Disallow: /a%3Cd.html",
"Disallow: /a/b.html",
"Disallow: /%7Ejoe/index.html",
"Disallow: /%7Ejoe/index.html" if sys.version_info < (3, 7) \
else "Disallow: /~joe/index.html",
]
self.rp.parse(lines)
self.assertEqual(str(self.rp), "\n".join(lines2))