def test_update_settings_per_key_priorities_new_behaviour():
    from scrapy.settings import BaseSettings
    test = EntrypointSettings()
    test.set('ITEM_PIPELINES', BaseSettings())
    test['ITEM_PIPELINES'].update({'test.path1': 100})
    test['ITEM_PIPELINES'].update({'test.path2': 200})
    assert dict(test['ITEM_PIPELINES']) == {
        'test.path1': 100, 'test.path2': 200}
示例#2
0
def test_update_settings_per_key_priorities_new_behaviour():
    from scrapy.settings import BaseSettings
    test = EntrypointSettings()
    test.set('ITEM_PIPELINES', BaseSettings())
    test['ITEM_PIPELINES'].update({'test.path1': 100})
    test['ITEM_PIPELINES'].update({'test.path2': 200})
    assert dict(test['ITEM_PIPELINES']) == {
        'test.path1': 100,
        'test.path2': 200
    }
示例#3
0
def test_update_settings_per_key_priorities_old_behavior():
    test = EntrypointSettings()
    test.set('ITEM_PIPELINES', {'path.one': 100})
    test.set('ITEM_PIPELINES', {'path.two': 200})
    assert test['ITEM_PIPELINES'] == {'path.two': 200}
def test_update_settings_per_key_priorities_old_behavior():
    test = EntrypointSettings()
    test.set('ITEM_PIPELINES', {'path.one': 100})
    test.set('ITEM_PIPELINES', {'path.two': 200})
    assert test['ITEM_PIPELINES'] == {'path.two': 200}