From f699bae6c70172e3f35a8edbbf77bba60cbbaa04 Mon Sep 17 00:00:00 2001 From: Callahan Kovacs Date: Mon, 7 Oct 2024 15:13:59 -0500 Subject: [PATCH] feat: support standard and kernel-modules Signed-off-by: Callahan Kovacs --- snapcraft/models/project.py | 2 +- tests/unit/models/test_projects.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/snapcraft/models/project.py b/snapcraft/models/project.py index 507a1161cd..10c571ab35 100644 --- a/snapcraft/models/project.py +++ b/snapcraft/models/project.py @@ -572,7 +572,7 @@ class Component(models.CraftBaseModel): summary: SummaryStr description: str - type: Literal["test"] + type: Literal["test", "kernel-modules", "standard"] version: VersionStr | None = None hooks: dict[str, Hook] | None = None diff --git a/tests/unit/models/test_projects.py b/tests/unit/models/test_projects.py index 99ccc4c4ee..eb782b95f8 100644 --- a/tests/unit/models/test_projects.py +++ b/tests/unit/models/test_projects.py @@ -2600,16 +2600,17 @@ def test_components_valid(self, project, project_yaml_data, stub_component_data) assert test_project.components == components + @pytest.mark.parametrize("component_type", ["test", "kernel-modules", "standard"]) def test_component_type_valid( - self, project, project_yaml_data, stub_component_data + self, component_type, project, project_yaml_data, stub_component_data ): component = {"foo": stub_component_data} - component["foo"]["type"] = "test" + component["foo"]["type"] = component_type test_project = project.unmarshal(project_yaml_data(components=component)) assert test_project.components - assert test_project.components["foo"].type == "test" + assert test_project.components["foo"].type == component_type def test_component_type_invalid( self, project, project_yaml_data, stub_component_data