diff --git a/pmb/core/arch.py b/pmb/core/arch.py index 237cdcce..409e8df8 100644 --- a/pmb/core/arch.py +++ b/pmb/core/arch.py @@ -61,6 +61,8 @@ class Arch(enum.Enum): return Arch.armhf case "armv7l" | "armv8l": return Arch.armv7 + case _: + raise ValueError(f"Unsupported machine type '{machine_type}'") @staticmethod def native() -> "Arch": diff --git a/pmb/core/test_arch.py b/pmb/core/test_arch.py index 7598eab5..a91a6130 100644 --- a/pmb/core/test_arch.py +++ b/pmb/core/test_arch.py @@ -77,3 +77,7 @@ def test_invalid_arches(): with pytest.raises(TypeError) as excinfo: "bap" / Arch.aarch64 assert "unsupported operand type(s) for /: 'str' and 'Arch'" in str(excinfo.value) + + with pytest.raises(ValueError) as excinfo: + Arch.from_machine_type("invalid") + assert "Unsupported machine type 'invalid'" in str(excinfo.value)