MCPcopy
hub / github.com/scrapy/scrapy / test_override_dict_settings

Method test_override_dict_settings

tests/test_cmdline/__init__.py:53–69  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

51 shutil.rmtree(path)
52
53 def test_override_dict_settings(self):
54 EXT_PATH = "tests.test_cmdline.extensions.DummyExtension"
55 EXTENSIONS = {EXT_PATH: 200}
56 settingsstr = self._execute(
57 "settings",
58 "--get",
59 "EXTENSIONS",
60 "-s",
61 "EXTENSIONS=" + json.dumps(EXTENSIONS),
62 )
63 # XXX: There's gotta be a smarter way to do this...
64 assert "..." not in settingsstr
65 for char in ("'", "<", ">"):
66 settingsstr = settingsstr.replace(char, '"')
67 settingsdict = json.loads(settingsstr)
68 assert set(settingsdict.keys()) == set(EXTENSIONS.keys())
69 assert settingsdict[EXT_PATH] == 200
70
71 def test_pathlib_path_as_feeds_key(self):
72 assert self._execute("settings", "--get", "FEEDS") == json.dumps(

Callers

nothing calls this directly

Calls 3

_executeMethod · 0.95
keysMethod · 0.80
replaceMethod · 0.45

Tested by

no test coverage detected