Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,18 @@ def test_vendor_backed_needs_two_distinct_vendors() -> None:
assert r.vendors == ["Atlassian", "GitHub"]


def test_chat_contract_is_green_with_slack_and_discord() -> None:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor — This builds synthetic tools and never reads the repo, so it passes even if tools/chat-discord/ doesn't exist or declares the wrong Kind/Vendor. To make it a real regression guard, assert against the live tree: load vns.load_tools(vns.find_repo_root()), check chat-discord is present with vendor Discord under contract:chat, and that the contract:chat result is green. Otherwise it duplicates test_vendor_backed_needs_two_distinct_vendors and can be dropped.

tools = [
_tool("chat", "contract:chat", vns.INTERFACE, "agnostic"),
_tool("chat-slack", "contract:chat", vns.IMPLEMENTATION, "Slack"),
_tool("chat-discord", "contract:chat", vns.IMPLEMENTATION, "Discord"),
]
r = _result(vns.score_contracts(tools), "contract:chat")
assert r.green is True
assert r.vendors == ["Discord", "Slack"]
assert "2 backend vendors: Discord, Slack" in r.basis


def test_vendor_backed_single_vendor_is_not_green() -> None:
tools = [_tool("gmail", "contract:mail-create", vns.IMPLEMENTATION, "Google")]
r = _result(vns.score_contracts(tools), "contract:mail-create")
Expand Down