mirror of https://github.com/scrapy/scrapy.git
Make scrapyd.eggutils compatible with Python 2.5 and added tests for get_spider_list_from_eggfile() function (closes #242)
This commit is contained in:
parent
aa86f180b9
commit
400c4134af
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import with_statement
|
||||
|
||||
import os, sys, shutil, pkg_resources
|
||||
from subprocess import Popen, PIPE
|
||||
from tempfile import NamedTemporaryFile, mkdtemp
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -0,0 +1,11 @@
|
|||
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']))
|
||||
Loading…
Reference in New Issue