1
0
Fork 0
mirror of synced 2025-01-03 03:39:00 -05:00
dotbot/tests/dotbot_plugin_issue_357.py
Anish Athalye b8891c5fb7 Fix regression test
This test was broken due to unused imports being automatically removed
in abecc97bad.
2024-12-27 23:32:29 -08:00

24 lines
663 B
Python

from typing import Any
from dotbot.plugin import Plugin
from dotbot.plugins import Clean, Create, Link, Shell
# https://github.com/anishathalye/dotbot/issues/357
# if we import from dotbot.plugins, the built-in plugins get executed multiple times
_: Any = Clean
_ = Create
_ = Link
_ = Shell
class NoopPlugin(Plugin):
_directive = "noop"
def can_handle(self, directive: str) -> bool:
return directive == self._directive
def handle(self, directive: str, _data: Any) -> bool:
if directive != self._directive:
msg = f"NoopPlugin cannot handle directive {directive}"
raise ValueError(msg)
return True