Public Access
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
29 lines
1.0 KiB
Python
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
|