From b828facff499e97f8d2dfec0c2fd5a76a5152237 Mon Sep 17 00:00:00 2001 From: Paul Tremberth Date: Thu, 15 Sep 2016 19:25:20 +0200 Subject: [PATCH] Add shell test for using scrapy.Request() directly without importing scrapy --- tests/test_command_shell.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/test_command_shell.py b/tests/test_command_shell.py index c532fc0d8..7bb7439d6 100644 --- a/tests/test_command_shell.py +++ b/tests/test_command_shell.py @@ -56,6 +56,13 @@ class ShellTest(ProcessTest, SiteTest, unittest.TestCase): errcode, out, _ = yield self.execute(['-c', code.format(url)]) self.assertEqual(errcode, 0, out) + @defer.inlineCallbacks + def test_scrapy_import(self): + url = self.url('/text') + code = "fetch(scrapy.Request('{0}'))" + errcode, out, _ = yield self.execute(['-c', code.format(url)]) + self.assertEqual(errcode, 0, out) + @defer.inlineCallbacks def test_local_file(self): filepath = join(tests_datadir, 'test_site/index.html')