mirror of https://github.com/scrapy/scrapy.git
Fix component exporting for Addon base class
This commit is contained in:
parent
8e5d067af1
commit
388c5c4b78
|
|
@ -84,7 +84,7 @@ class Addon(object):
|
|||
# e.g. for DOWNLOADER_MIDDLEWARES: {'myclass': 100}
|
||||
k = comp
|
||||
v = config.get('order', self.component_order)
|
||||
settings.set(self.component_type, {k: v}, 'addon')
|
||||
settings[self.component_type].update({k: v}, 'addon')
|
||||
|
||||
def export_basics(self, settings):
|
||||
"""Export the :attr:`basic_settings` attribute into the settings object.
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ class AddonTest(unittest.TestCase):
|
|||
verifyObject(IAddon, self.testaddon)
|
||||
|
||||
def test_export_component(self):
|
||||
settings = BaseSettings({'ITEM_PIPELINES': {}}, 'default')
|
||||
settings = BaseSettings({'ITEM_PIPELINES': BaseSettings(),
|
||||
'DOWNLOAD_HANDLERS': BaseSettings()},
|
||||
'default')
|
||||
self.testaddon.component_type = None
|
||||
self.testaddon.export_component({}, settings)
|
||||
self.assertEqual(len(settings['ITEM_PIPELINES']), 0)
|
||||
|
|
|
|||
Loading…
Reference in New Issue