Files
devx/tests/unit/test_utils_confirm.py
emil ef3b882e5b
Post-merge / detect-type (push) Successful in 13s
Post-merge / validate-commit-msg (push) Successful in 10s
Post-merge / configure-repo (push) Successful in 28s
Post-merge / vikunja (push) Successful in 44s
Post-merge / sync-wiki (push) Successful in 58s
Post-merge / release (push) Successful in 1m7s
Post-merge / publish (push) Successful in 44s
Post-merge / badges (push) Successful in 1m6s
DEVX-124: feat: extract shared utilities from infra and grm into devx
2026-07-09 11:51:50 +00:00

29 lines
1.0 KiB
Python

"""Unit tests for devx.utils.confirm."""
from __future__ import annotations
from devx.utils.confirm import validate_confirmation
class TestValidateConfirmation:
def test_exact_match(self) -> None:
assert validate_confirmation("deploy-production", "deploy-production") is True
def test_mismatch(self) -> None:
assert validate_confirmation("deploy-staging", "deploy-production") is False
def test_empty_string(self) -> None:
assert validate_confirmation("", "deploy-production") is False
def test_case_sensitive(self) -> None:
assert validate_confirmation("Deploy-Production", "deploy-production") is False
def test_partial_match(self) -> None:
assert validate_confirmation("deploy", "deploy-production") is False
def test_extra_whitespace(self) -> None:
assert validate_confirmation("deploy-production ", "deploy-production") is False
def test_custom_expected(self) -> None:
assert validate_confirmation("yes-delete-all", "yes-delete-all") is True