hub-core/tests/test_migration_environment.py
tegwick 826874a47e
Some checks failed
CI Smoke / host-smoke (push) Successful in 0s
CI Smoke / pytest-smoke (push) Failing after 2s
fix: enforce durable migration ownership and readiness
2026-08-21 17:54:21 +02:00

12 lines
449 B
Python

from __future__ import annotations
import pytest
from hub_core.migrations.roles import migration_role_statement
def test_migration_role_is_quoted_and_validated() -> None:
assert migration_role_statement("hub_runtime_owner") == 'SET ROLE "hub_runtime_owner"'
assert migration_role_statement(None) is None
with pytest.raises(ValueError, match="safe PostgreSQL role"):
migration_role_statement('owner"; DROP SCHEMA public; --')