From 7b8ea003611fbec65565e38bc3bdf336037c61f9 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Wed, 26 Aug 2020 12:44:56 +0200 Subject: [PATCH] tests: add Mageia 5 detection test Reviewed-by: Cole Robinson Signed-off-by: Pino Toscano --- tests/data/urldetect/mageia/5/VERSION | 1 + tests/test_urldetect.py | 1 + virtinst/install/urldetect.py | 4 ++-- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 tests/data/urldetect/mageia/5/VERSION diff --git a/tests/data/urldetect/mageia/5/VERSION b/tests/data/urldetect/mageia/5/VERSION new file mode 100644 index 00000000..6985e21f --- /dev/null +++ b/tests/data/urldetect/mageia/5/VERSION @@ -0,0 +1 @@ +Mageia 5 Official-x86_64-Download 20180807 23:39 diff --git a/tests/test_urldetect.py b/tests/test_urldetect.py index 71e5e1a8..2472523e 100644 --- a/tests/test_urldetect.py +++ b/tests/test_urldetect.py @@ -130,6 +130,7 @@ def test_suse(): def test_mageia(): + _test("mageia/5", "mageia5", initrd="all.rdz") _test("mageia/8", initrd="all.rdz") diff --git a/virtinst/install/urldetect.py b/virtinst/install/urldetect.py index 908781e6..a73b0bf1 100644 --- a/virtinst/install/urldetect.py +++ b/virtinst/install/urldetect.py @@ -796,9 +796,9 @@ class _MageiaDistro(_DistroTree): if not content: return False - m = re.match("^Mageia (\d+) .*", content) + m = re.match(r"^Mageia (\d+) .*", content) if not m: - return False + return False # pragma: no cover cache.mageia_version = m.group(1)