mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-20 18:06:08 -05:00
[Downloader] Install SHARED_LIBRARY requirements (#2384)
SHARED_LIBRARY Installable types did not have the requirements as defined in info.json automatically installed. This change updates the installation of libraries to also install their requirements. Resolves #2381
This commit is contained in:
@@ -14,7 +14,9 @@ __all__ = [
|
||||
"repo_norun",
|
||||
"bot_repo",
|
||||
"INFO_JSON",
|
||||
"LIBRARY_INFO_JSON",
|
||||
"installable",
|
||||
"library_installable",
|
||||
"fake_run_noprint",
|
||||
]
|
||||
|
||||
@@ -92,6 +94,19 @@ INFO_JSON = {
|
||||
"type": "COG",
|
||||
}
|
||||
|
||||
LIBRARY_INFO_JSON = {
|
||||
"author": ("seputaes",),
|
||||
"bot_version": (3, 0, 0),
|
||||
"description": "A long library description",
|
||||
"hidden": False, # libraries are always hidden, this tests it will be flipped
|
||||
"install_msg": "A library install message",
|
||||
"required_cogs": {},
|
||||
"requirements": ("tabulate"),
|
||||
"short": "A short library description",
|
||||
"tags": ("libtag1", "libtag2"),
|
||||
"type": "SHARED_LIBRARY",
|
||||
}
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def installable(tmpdir):
|
||||
@@ -101,3 +116,13 @@ def installable(tmpdir):
|
||||
|
||||
cog_info = Installable(Path(str(cog_path)))
|
||||
return cog_info
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def library_installable(tmpdir):
|
||||
lib_path = tmpdir.mkdir("test_repo").mkdir("test_lib")
|
||||
info_path = lib_path.join("info.json")
|
||||
info_path.write_text(json.dumps(LIBRARY_INFO_JSON), "utf-8")
|
||||
|
||||
cog_info = Installable(Path(str(lib_path)))
|
||||
return cog_info
|
||||
|
||||
Reference in New Issue
Block a user