11 lines
582 B
Python
11 lines
582 B
Python
from app.services.dingtalk_auth import DingTalkAuthService
|
|
|
|
|
|
def test_dingtalk_role_mapping() -> None:
|
|
assert DingTalkAuthService.map_role("产品开发部", "工程师") == "dev"
|
|
assert DingTalkAuthService.map_role("品控部", "质量主管") == "qc"
|
|
assert DingTalkAuthService.map_role("采购部", "采购专员") == "procurement"
|
|
assert DingTalkAuthService.map_role("", "审核员") == "reviewer"
|
|
assert DingTalkAuthService.map_role("", "", is_admin=True) == "admin"
|
|
assert DingTalkAuthService.map_role("未知部门", "普通员工") == "普通用户"
|