MCPcopy
hub / github.com/scrapy/scrapy / test_extension_enabled

Method test_extension_enabled

tests/test_extension_periodic_log.py:74–88  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

72
73class TestPeriodicLog:
74 def test_extension_enabled(self):
75 # Expected that settings for this extension loaded successfully
76 # And on certain conditions - extension raising NotConfigured
77
78 # "PERIODIC_LOG_STATS": True -> set to {"enabled": True}
79 # due to TypeError exception from settings.getdict
80 assert extension({"PERIODIC_LOG_STATS": True, "LOGSTATS_INTERVAL": 60})
81
82 # "PERIODIC_LOG_STATS": "True" -> set to {"enabled": True}
83 # due to JSONDecodeError(ValueError) exception from settings.getdict
84 assert extension({"PERIODIC_LOG_STATS": "True", "LOGSTATS_INTERVAL": 60})
85
86 # The ame for PERIODIC_LOG_DELTA:
87 assert extension({"PERIODIC_LOG_DELTA": True, "LOGSTATS_INTERVAL": 60})
88 assert extension({"PERIODIC_LOG_DELTA": "True", "LOGSTATS_INTERVAL": 60})
89
90 @coroutine_test
91 async def test_log_delta(self):

Callers

nothing calls this directly

Calls 1

extensionFunction · 0.85

Tested by

no test coverage detected