35 lines
1.5 KiB
Python
35 lines
1.5 KiB
Python
# #region Test.DashboardReleaseModel [C:3] [TYPE Module] [SEMANTICS test,git,release,model]
|
|
# @BRIEF Verify immutable dashboard release ledger fields.
|
|
# @RELATION BINDS_TO -> [DashboardRelease]
|
|
# @TEST_CONTRACT: Valid release input -> immutable repository-scoped release record.
|
|
# @TEST_EDGE: duplicate_version -> database unique constraint owns rejection.
|
|
# @TEST_EDGE: missing_notes -> API schema rejects before persistence.
|
|
# @TEST_EDGE: changed_preprod -> release route marks the active release superseded.
|
|
# @TEST_INVARIANT: SourceHashesImmutable -> VERIFIED_BY: stores_pinned_candidate_hashes.
|
|
|
|
from src.models.dashboard_release import DashboardRelease
|
|
|
|
|
|
class TestDashboardRelease:
|
|
# #region test_stores_pinned_candidate_hashes [C:2] [TYPE Function]
|
|
# @BRIEF A release retains the exact commit and semantic content hash selected in PREPROD.
|
|
def test_stores_pinned_candidate_hashes(self):
|
|
release = DashboardRelease(
|
|
repository_id="repo-1",
|
|
deployment_id=17,
|
|
name="July dashboard",
|
|
version="2026.07.16",
|
|
notes="Новый фильтр региона",
|
|
commit_hash="a" * 40,
|
|
content_hash="b" * 64,
|
|
status="awaiting_approval",
|
|
created_by="analyst",
|
|
)
|
|
assert release.commit_hash == "a" * 40
|
|
assert release.content_hash == "b" * 64
|
|
assert release.status == "awaiting_approval"
|
|
# #endregion test_stores_pinned_candidate_hashes
|
|
|
|
|
|
# #endregion Test.DashboardReleaseModel
|