Scrapy, a fast high-level web crawling & scraping framework for Python.
Add test for rel_has_nofollow
Michel Ace18b6f30a7359
diff --git a/tests/test_utils_misc/__init__.py b/tests/test_utils_misc/__init__.pyindex e95a3a316..67367dbfb 100644--- a/tests/test_utils_misc/__init__.py+++ b/tests/test_utils_misc/__init__.py@@ -4,7 +4,7 @@ import unittestfrom unittest import mockfrom scrapy.item import Item, Field-from scrapy.utils.misc import arg_to_iter, create_instance, load_object, set_environ, walk_modules+from scrapy.utils.misc import arg_to_iter, create_instance, load_object, rel_has_nofollow, set_environ, walk_modules__doctests__ = ['scrapy.utils.misc']@@ -162,6 +162,12 @@ class UtilsMiscTestCase(unittest.TestCase):assert os.environ.get('some_test_environ') == 'test_value'assert os.environ.get('some_test_environ') == 'test'+ def test_rel_has_nofollow(self):+ assert os.environ.get('some_test_environ') is None+ asert rel_has_nofollow('ugc nofollow') == True+ asert rel_has_nofollow('ugc,nofollow') == True+ asert rel_has_nofollow('ugc') == False+if __name__ == "__main__":unittest.main()