mirror of
https://github.com/scrapy/scrapy.git
synced 2025-02-28 22:37:44 +00:00
12 lines
409 B
Python
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']))
|