MCPcopy
hub / github.com/scrapy/scrapy / test_copy_to_dict

Method test_copy_to_dict

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

Source from the content-addressed store, hash-verified

379 assert copy.get("TEST_LIST_OF_LISTS")[0] == ["first_one", "first_two"]
380
381 def test_copy_to_dict(self):
382 s = BaseSettings(
383 {
384 "TEST_STRING": "a string",
385 "TEST_LIST": [1, 2],
386 "TEST_BOOLEAN": False,
387 "TEST_BASE": BaseSettings({1: 1, 2: 2}, "project"),
388 "TEST": BaseSettings({1: 10, 3: 30}, "default"),
389 "HASNOBASE": BaseSettings({3: 3000}, "default"),
390 }
391 )
392 assert s.copy_to_dict() == {
393 "HASNOBASE": {3: 3000},
394 "TEST": {1: 10, 3: 30},
395 "TEST_BASE": {1: 1, 2: 2},
396 "TEST_LIST": [1, 2],
397 "TEST_BOOLEAN": False,
398 "TEST_STRING": "a string",
399 }
400
401 def test_freeze(self):
402 self.settings.freeze()

Callers

nothing calls this directly

Calls 2

copy_to_dictMethod · 0.95
BaseSettingsClass · 0.90

Tested by

no test coverage detected