Red-DiscordBot/tests/core/test_app_commands.py
2023-03-27 20:49:59 -04:00

24 lines
627 B
Python

import inspect
import pytest
from discord import app_commands as dpy_app_commands
from redbot.core import app_commands
def test_dpy_app_commands_reexports():
dpy_attrs = set()
for attr_name, attr_value in dpy_app_commands.__dict__.items():
if attr_name.startswith("_") or inspect.ismodule(attr_value):
continue
dpy_attrs.add(attr_name)
missing_attrs = dpy_attrs - set(app_commands.__dict__.keys())
if missing_attrs:
pytest.fail(
"redbot.core.app_commands is missing these names from discord.app_commands: "
+ ", ".join(missing_attrs)
)