Skip to content

Commit

Permalink
feat: support standard and kernel-modules
Browse files Browse the repository at this point in the history
Signed-off-by: Callahan Kovacs <[email protected]>
  • Loading branch information
mr-cal committed Oct 7, 2024
1 parent df6ae07 commit b97e356
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion snapcraft/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 4 additions & 3 deletions tests/unit/models/test_projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b97e356

Please sign in to comment.