[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:
Seputaes
2019-02-26 21:07:05 -08:00
committed by Toby Harradine
parent 5a15939f08
commit 16614168a7
5 changed files with 64 additions and 4 deletions

View File

@@ -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