Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion slack_cli_hooks/hooks/get_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,17 @@
"doctor": f"{EXEC} -m slack_cli_hooks.hooks.doctor",
},
"config": {
"watch": {"filter-regex": "(^manifest\\.json$)", "paths": ["."]},
"protocol-version": [MessageBoundaryProtocol.name, DefaultProtocol.name],
"sdk-managed-connection-enabled": True,
"watch": {
"app": {
"filter-regex": "\\.py$",
"paths": ["."],
},
"manifest": {
"paths": ["manifest.json"],
},
},
},
"runtime": "python",
}
Expand Down
15 changes: 9 additions & 6 deletions tests/slack_cli_hooks/hooks/test_get_hooks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import re

from slack_cli_hooks.hooks.get_hooks import hooks_payload


Expand All @@ -18,13 +16,18 @@ def test_hooks_payload_config(self):
assert config["sdk-managed-connection-enabled"] is True
assert config["protocol-version"] == ["message-boundaries", "default"]

def test_hooks_watch_regex(self):
def test_hooks_watch_app(self):
config = hooks_payload["config"]

assert config["watch"] is not None
assert config["watch"]["app"] is not None
assert config["watch"]["app"]["filter-regex"] == "\\.py$"
assert config["watch"]["app"]["paths"] == ["."]

filter_regex = config["watch"]["filter-regex"]
assert re.match(filter_regex, "manifest.json") is not None
def test_hooks_watch_manifest(self):
config = hooks_payload["config"]
assert config["watch"] is not None
assert config["watch"]["manifest"] is not None
assert config["watch"]["manifest"]["paths"] == ["manifest.json"]

def test_hooks_runtime(self):
runtime = hooks_payload["runtime"]
Expand Down