pmb.core.arch: Handle unsupported arches in from_machine_type() better (MR 2498)

Closes https://gitlab.postmarketos.org/postmarketOS/pmbootstrap/-/issues/2501
This commit is contained in:
Newbyte 2024-11-22 11:34:39 +01:00
parent 8012b3cefe
commit 0752a202aa
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
2 changed files with 6 additions and 0 deletions

View file

@ -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)