MCPcopy
hub / github.com/scrapy/scrapy / test_getwithbase

Method test_getwithbase

tests/test_settings/__init__.py:339–350  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

337 assert settings.getpriority("nonexistentkey") is None
338
339 def test_getwithbase(self):
340 s = BaseSettings(
341 {
342 "TEST_BASE": BaseSettings({1: 1, 2: 2}, "project"),
343 "TEST": BaseSettings({1: 10, 3: 30}, "default"),
344 "HASNOBASE": BaseSettings({3: 3000}, "default"),
345 }
346 )
347 s["TEST"].set(2, 200, "cmdline")
348 assert set(s.getwithbase("TEST")) == {1, 2, 3}
349 assert set(s.getwithbase("HASNOBASE")) == set(s["HASNOBASE"])
350 assert s.getwithbase("NONEXISTENT") == {}
351
352 def test_maxpriority(self):
353 # Empty settings should return 'default'

Callers

nothing calls this directly

Calls 3

getwithbaseMethod · 0.95
BaseSettingsClass · 0.90
setMethod · 0.45

Tested by

no test coverage detected