core: chroot: Deduplicate supported arch list (MR 2476)

self.arch is a property and calls Arch.from_str, which errors upon
encountering an unknown architecture. Therefore, the error message is
changed and needs to be adjusted in the tests. Since Arch.supported is a
set, error messages were not deterministic before, so we need to sort
the list of architectures now.

Signed-off-by: Jens Reidel <adrian@travitia.xyz>
This commit is contained in:
Jens Reidel 2024-10-07 00:32:04 +02:00
parent 6d72043ac2
commit 9ca0ada582
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
3 changed files with 6 additions and 12 deletions

View file

@ -42,7 +42,10 @@ def test_invalid_chroots(pmb_args):
with pytest.raises(ValueError) as excinfo:
Chroot(ChrootType.BUILDROOT, "BAD_ARCH")
assert str(excinfo.value) == "Invalid buildroot suffix: 'BAD_ARCH'"
assert (
str(excinfo.value)
== "Invalid architecture: 'BAD_ARCH', expected something like: aarch64, armhf, armv7, riscv64, x86, x86_64"
)
with pytest.raises(ValueError) as excinfo:
Chroot(ChrootType.NATIVE, "aarch64")