Add approval instance drafts with menu badges, dual-track user/role read model and role bound names, form-designer outline docs, and bare-metal test deploy scripts. Ignore local test-server credential file. Co-authored-by: Cursor <cursoragent@cursor.com>
32 lines
1.2 KiB
Python
32 lines
1.2 KiB
Python
"""按有效角色查用户:空入参行为(不依赖 DB)。"""
|
|
from app.services.web_auth_roles import (
|
|
list_user_ids_with_any_effective_role_ids,
|
|
list_user_ids_with_effective_role_name,
|
|
)
|
|
|
|
|
|
class _DummySession:
|
|
def query(self, *args, **kwargs): # pragma: no cover
|
|
raise AssertionError("空入参不应访问数据库")
|
|
|
|
|
|
def test_list_by_role_name_empty_inputs():
|
|
db = _DummySession()
|
|
assert list_user_ids_with_effective_role_name(db, tenant_no="", role_name="实验专员") == set()
|
|
assert list_user_ids_with_effective_role_name(db, tenant_no="zkxw", role_name="") == set()
|
|
assert list_user_ids_with_effective_role_name(
|
|
db, tenant_no="zkxw", role_name="实验专员", candidate_user_ids=[]
|
|
) == set()
|
|
|
|
|
|
def test_list_by_role_ids_empty_inputs():
|
|
db = _DummySession()
|
|
assert list_user_ids_with_any_effective_role_ids(db, tenant_no="zkxw", role_ids=[]) == []
|
|
assert list_user_ids_with_any_effective_role_ids(db, tenant_no="", role_ids=["r1"]) == []
|
|
assert (
|
|
list_user_ids_with_any_effective_role_ids(
|
|
db, tenant_no="zkxw", role_ids=["r1"], candidate_user_ids=[]
|
|
)
|
|
== []
|
|
)
|