mirror of https://github.com/scrapy/scrapy.git
test that default start_request return value type is a generator. refs #98
This commit is contained in:
parent
45685ea6cd
commit
2909a60e95
|
|
@ -1,4 +1,4 @@
|
|||
import gzip, warnings
|
||||
import gzip, warnings, inspect
|
||||
from cStringIO import StringIO
|
||||
|
||||
from twisted.trial import unittest
|
||||
|
|
@ -24,6 +24,12 @@ class BaseSpiderTest(unittest.TestCase):
|
|||
self.assertEqual(spider.name, 'example.com')
|
||||
self.assertEqual(spider.start_urls, [])
|
||||
|
||||
def test_start_requests(self):
|
||||
spider = self.spider_class('example.com')
|
||||
start_requests = spider.start_requests()
|
||||
self.assertTrue(inspect.isgenerator(start_requests))
|
||||
self.assertEqual(list(start_requests), [])
|
||||
|
||||
def test_spider_args(self):
|
||||
"""Constructor arguments are assigned to spider attributes"""
|
||||
spider = self.spider_class('example.com', foo='bar')
|
||||
|
|
|
|||
Loading…
Reference in New Issue