Archived
Refactor UI assets and harden quality checks
This commit is contained in:
1 parent
23ab466c52
commit
4ecc8eb874
62 files changed
+3314
-3206
No files matched your search
@@ -0,0 +1,22 @@
|
||||
from karldns.schemas import _account_status, _row_text
|
||||
|
||||
|
||||
def test_row_text_returns_none_for_missing_or_empty_values():
|
||||
row = {
|
||||
"empty": "",
|
||||
"missing": None,
|
||||
"number": 42,
|
||||
"text": "hello",
|
||||
}
|
||||
|
||||
assert _row_text(row, "empty") is None
|
||||
assert _row_text(row, "missing") is None
|
||||
assert _row_text(row, "unknown") is None
|
||||
assert _row_text(row, "number") == "42"
|
||||
assert _row_text(row, "text") == "hello"
|
||||
|
||||
|
||||
def test_account_status_prefers_disabled_before_lifecycle_state():
|
||||
assert _account_status({"disabled": True, "accepted_at": "2026-01-01"}) == "disabled"
|
||||
assert _account_status({"accepted_at": "2026-01-01"}) == "active"
|
||||
assert _account_status({}) == "pending"
|
||||
Reference in new issue
Block a user