mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-24 14:24:35 +00:00
15 lines
507 B
Python
15 lines
507 B
Python
import unittest
|
|
from cStringIO import StringIO
|
|
|
|
from scrapyd.eggutils import get_spider_list_from_eggfile
|
|
from scrapy.utils.py26 import get_data
|
|
|
|
__package__ = 'scrapyd.tests' # required for compatibility with python 2.5
|
|
|
|
class EggUtilsTest(unittest.TestCase):
|
|
|
|
def test_get_spider_list_from_eggfile(self):
|
|
eggfile = StringIO(get_data(__package__, 'mybot.egg'))
|
|
spiders = get_spider_list_from_eggfile(eggfile, 'mybot')
|
|
self.assertEqual(set(spiders), set(['spider1', 'spider2']))
|