mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-06 11:18:54 -05:00
##### Core requirements * _discord.py_ Rapptz/discord.py@77239e4 -> Rapptz/discord.py@836ae73 * _aiohttp-json-rpc_ 0.11.1 -> 0.11.2 * _aiohttp_ 3.3.2 -> 3.4.4 ##### [test] * _pytest_ 3.8.1 -> 3.8.2 ##### [docs] * _packaging_ 17.1 -> 18.0 * _pyparsing_ 2.2.1 -> 2.2.2 * _six_ Removed duplicate entry ##### [style] * _black_ 18.6b4 -> 18.9b0 * _click_ 6.7 -> 7.0 ### Notes - `extra_requires` in setup.py is now a module-level global - Some style changes have occurred after the _black_ update Signed-off-by: Toby Harradine <tobyharradine@gmail.com>
67 lines
2.4 KiB
Python
67 lines
2.4 KiB
Python
from redbot.cogs.permissions.permissions import Permissions, GLOBAL
|
|
|
|
|
|
def test_schema_update():
|
|
old = {
|
|
GLOBAL: {
|
|
"owner_models": {
|
|
"cogs": {
|
|
"Admin": {"allow": [78631113035100160], "deny": [96733288462286848]},
|
|
"Audio": {"allow": [133049272517001216], "default": "deny"},
|
|
},
|
|
"commands": {
|
|
"cleanup bot": {"allow": [78631113035100160], "default": "deny"},
|
|
"ping": {
|
|
"allow": [96733288462286848],
|
|
"deny": [96733288462286848],
|
|
"default": "allow",
|
|
},
|
|
},
|
|
}
|
|
},
|
|
43733288462286848: {
|
|
"owner_models": {
|
|
"cogs": {
|
|
"Admin": {
|
|
"allow": [24231113035100160],
|
|
"deny": [35533288462286848, 24231113035100160],
|
|
},
|
|
"General": {"allow": [133049272517001216], "default": "deny"},
|
|
},
|
|
"commands": {
|
|
"cleanup bot": {"allow": [17831113035100160], "default": "allow"},
|
|
"set adminrole": {
|
|
"allow": [87733288462286848],
|
|
"deny": [95433288462286848],
|
|
"default": "allow",
|
|
},
|
|
},
|
|
}
|
|
},
|
|
}
|
|
new = Permissions._get_updated_schema(old)
|
|
assert new == (
|
|
{
|
|
"Admin": {
|
|
GLOBAL: {78631113035100160: True, 96733288462286848: False},
|
|
43733288462286848: {24231113035100160: True, 35533288462286848: False},
|
|
},
|
|
"Audio": {GLOBAL: {133049272517001216: True, "default": False}},
|
|
"General": {43733288462286848: {133049272517001216: True, "default": False}},
|
|
},
|
|
{
|
|
"cleanup bot": {
|
|
GLOBAL: {78631113035100160: True, "default": False},
|
|
43733288462286848: {17831113035100160: True, "default": True},
|
|
},
|
|
"ping": {GLOBAL: {96733288462286848: True, "default": True}},
|
|
"set adminrole": {
|
|
43733288462286848: {
|
|
87733288462286848: True,
|
|
95433288462286848: False,
|
|
"default": True,
|
|
}
|
|
},
|
|
},
|
|
)
|