(caplog)
| 155 | |
| 156 | |
| 157 | async def test_loader(caplog): |
| 158 | with taddons.context() as tctx: |
| 159 | loader = addonmanager.Loader(tctx.master) |
| 160 | loader.add_option("custom_option", bool, False, "help") |
| 161 | assert "custom_option" in loader.master.options |
| 162 | |
| 163 | # calling this again with the same signature is a no-op. |
| 164 | loader.add_option("custom_option", bool, False, "help") |
| 165 | assert not caplog.text |
| 166 | |
| 167 | # a different signature should emit a warning though. |
| 168 | loader.add_option("custom_option", bool, True, "help") |
| 169 | assert "Over-riding existing option" in caplog.text |
| 170 | |
| 171 | def cmd(a: str) -> str: |
| 172 | return "foo" |
| 173 | |
| 174 | loader.add_command("test.command", cmd) |
| 175 | |
| 176 | |
| 177 | async def test_simple(caplog): |
nothing calls this directly
no test coverage detected
searching dependent graphs…