-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_config.py
More file actions
31 lines (26 loc) · 1.09 KB
/
Copy pathtest_config.py
File metadata and controls
31 lines (26 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
LuckPermsConfig 单元测试。
"""
from luckperms.config import LuckPermsConfig
from luckperms.query import PermissionQuery
class TestLuckPermsConfig:
def test_default_values(self):
cfg = LuckPermsConfig()
assert cfg.apply_bukkit_child_permissions is True
assert cfg.apply_implicit_wildcards is True
assert cfg.primary_group_calculation == "stored"
def test_custom_values(self):
cfg = LuckPermsConfig(
apply_bukkit_child_permissions=False,
primary_group_calculation="parents-by-weight",
)
assert cfg.apply_bukkit_child_permissions is False
assert cfg.apply_implicit_wildcards is True
assert cfg.primary_group_calculation == "parents-by-weight"
def test_query_uses_default_config(self):
q = PermissionQuery({}, {})
assert q._config.apply_bukkit_child_permissions is True
def test_query_uses_custom_config(self):
cfg = LuckPermsConfig(apply_implicit_wildcards=False)
q = PermissionQuery({}, {}, config=cfg)
assert q._config.apply_implicit_wildcards is False