1
0
mirror of https://github.com/scrapy/scrapy.git synced 2025-02-28 15:07:05 +00:00
scrapy/scrapyd/tests/test_eggutils.py

12 lines
409 B
Python

import pkgutil, unittest
from cStringIO import StringIO
from scrapyd.eggutils import get_spider_list_from_eggfile
class EggUtilsTest(unittest.TestCase):
def test_get_spider_list_from_eggfile(self):
eggfile = StringIO(pkgutil.get_data(__package__, 'mybot.egg'))
spiders = get_spider_list_from_eggfile(eggfile, 'mybot')
self.assertEqual(set(spiders), set(['spider1', 'spider2']))