mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-05 08:52:31 -05:00
Privatize APIs by renaming or removing them from __all__ (#6021)
This commit is contained in:
@@ -4,7 +4,7 @@ import os
|
||||
import pytest
|
||||
|
||||
from redbot import _update_event_loop_policy
|
||||
from redbot.core import drivers, data_manager
|
||||
from redbot.core import _drivers, data_manager
|
||||
|
||||
_update_event_loop_policy()
|
||||
|
||||
@@ -21,9 +21,9 @@ def event_loop(request):
|
||||
|
||||
def _get_backend_type():
|
||||
if os.getenv("RED_STORAGE_TYPE") == "postgres":
|
||||
return drivers.BackendType.POSTGRES
|
||||
return _drivers.BackendType.POSTGRES
|
||||
else:
|
||||
return drivers.BackendType.JSON
|
||||
return _drivers.BackendType.JSON
|
||||
|
||||
|
||||
@pytest.fixture(scope="session", autouse=True)
|
||||
@@ -32,7 +32,7 @@ async def _setup_driver():
|
||||
storage_details = {}
|
||||
data_manager.storage_type = lambda: backend_type.value
|
||||
data_manager.storage_details = lambda: storage_details
|
||||
driver_cls = drivers.get_driver_class(backend_type)
|
||||
driver_cls = _drivers.get_driver_class(backend_type)
|
||||
await driver_cls.initialize(**storage_details)
|
||||
yield
|
||||
await driver_cls.teardown()
|
||||
|
||||
@@ -3,7 +3,7 @@ from pathlib import Path
|
||||
import pytest
|
||||
|
||||
from redbot.pytest.cog_manager import *
|
||||
from redbot.core import cog_manager
|
||||
from redbot.core import _cog_manager
|
||||
|
||||
|
||||
@pytest.mark.skip
|
||||
@@ -12,7 +12,7 @@ async def test_ensure_cogs_in_paths(cog_mgr, default_dir):
|
||||
assert cogs_dir in await cog_mgr.paths()
|
||||
|
||||
|
||||
async def test_install_path_set(cog_mgr: cog_manager.CogManager, tmpdir):
|
||||
async def test_install_path_set(cog_mgr: _cog_manager.CogManager, tmpdir):
|
||||
path = Path(str(tmpdir))
|
||||
await cog_mgr.set_install_path(path)
|
||||
assert await cog_mgr.install_path() == path
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import pytest
|
||||
|
||||
from redbot.pytest.rpc import *
|
||||
from redbot.core.rpc import get_name
|
||||
from redbot.core._rpc import get_name
|
||||
|
||||
|
||||
def test_get_name(cog):
|
||||
|
||||
Reference in New Issue
Block a user