1
0
Fork 0
mirror of synced 2024-11-16 05:35:33 -05:00
dotbot/tests/test_dispatcher.py
Wouter Franken e2c455213c Add plugin dispatch test
Add test to verify that a plugin can run dispatch to handle subtasks of
external plugins.
2023-02-19 13:09:00 +01:00

22 lines
664 B
Python

import os
import shutil
import pytest
def test_plugin_dispatcher(capfd, home, dotfiles, run_dotbot):
"""Verify that plugins can call dispatcher without explicitly specifying plugins."""
dotfiles.makedirs("plugins")
plugin_file = os.path.join(
os.path.dirname(os.path.abspath(__file__)), "dotbot_plugin_dispatch.py"
)
shutil.copy(plugin_file, os.path.join(dotfiles.directory, "plugins", "dispatch.py"))
dotfiles.write_config(
[
{"dispatch": [{"create": ["~/a"]}]},
]
)
run_dotbot("--plugin-dir", os.path.join(dotfiles.directory, "plugins"))
assert os.path.exists(os.path.join(home, "a"))