lib/modules: list modules consistent argument
This commit is contained in:
@@ -27,7 +27,7 @@ from clan_lib.machines.machines import Machine as MachineMachine
|
|||||||
@pytest.mark.with_core
|
@pytest.mark.with_core
|
||||||
def test_list_modules(test_flake_with_core: FlakeForTest) -> None:
|
def test_list_modules(test_flake_with_core: FlakeForTest) -> None:
|
||||||
base_path = test_flake_with_core.path
|
base_path = test_flake_with_core.path
|
||||||
modules_info = list_service_modules(str(base_path))
|
modules_info = list_service_modules(Flake(str(base_path)))
|
||||||
|
|
||||||
assert "modules" in modules_info
|
assert "modules" in modules_info
|
||||||
|
|
||||||
|
|||||||
@@ -158,11 +158,10 @@ class ModuleList(TypedDict):
|
|||||||
|
|
||||||
|
|
||||||
@API.register
|
@API.register
|
||||||
def list_service_modules(base_path: str) -> ModuleList:
|
def list_service_modules(flake: Flake) -> ModuleList:
|
||||||
"""
|
"""
|
||||||
Show information about a module
|
Show information about a module
|
||||||
"""
|
"""
|
||||||
flake = Flake(base_path)
|
|
||||||
modules = flake.select("clanInternals.inventoryClass.modulesPerSource")
|
modules = flake.select("clanInternals.inventoryClass.modulesPerSource")
|
||||||
|
|
||||||
return ModuleList({"modules": modules})
|
return ModuleList({"modules": modules})
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ def test_clan_create_api(
|
|||||||
store = InventoryStore(clan_dir_flake)
|
store = InventoryStore(clan_dir_flake)
|
||||||
inventory = store.read()
|
inventory = store.read()
|
||||||
|
|
||||||
modules = list_service_modules(str(clan_dir_flake.path))
|
modules = list_service_modules(clan_dir_flake)
|
||||||
assert (
|
assert (
|
||||||
modules["modules"]["clan-core"]["admin"]["manifest"]["name"]
|
modules["modules"]["clan-core"]["admin"]["manifest"]["name"]
|
||||||
== "clan-core/admin"
|
== "clan-core/admin"
|
||||||
|
|||||||
Reference in New Issue
Block a user