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