(self)
| 100 | assert dh._get_handler("scheme") is None |
| 101 | |
| 102 | def test_lazy_handlers(self): |
| 103 | handlers = {"scheme": DummyLazyDH} |
| 104 | crawler = get_crawler(settings_dict={"DOWNLOAD_HANDLERS": handlers}) |
| 105 | with pytest.warns( |
| 106 | ScrapyDeprecationWarning, |
| 107 | match="DummyLazyDH doesn't define a 'lazy' attribute", |
| 108 | ): |
| 109 | dh = DownloadHandlers(crawler) |
| 110 | assert "scheme" in dh._schemes |
| 111 | assert "scheme" not in dh._handlers |
| 112 | handler = dh._get_handler("scheme") # force load lazy handler |
| 113 | assert handler |
| 114 | assert "scheme" in dh._handlers |
| 115 | assert "scheme" not in dh._notconfigured |
| 116 | |
| 117 | |
| 118 | class TestFile: |
nothing calls this directly
no test coverage detected