Просмотр исходного кода

Add unit tests for `osmorphing.rocky.py` module

Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Mihaela Balutoiu 2 лет назад
Родитель
Сommit
ed29e4af01
1 измененных файлов с 31 добавлено и 0 удалено
  1. 31 0
      coriolis/tests/osmorphing/test_rocky.py

+ 31 - 0
coriolis/tests/osmorphing/test_rocky.py

@@ -0,0 +1,31 @@
+# Copyright 2024 Cloudbase Solutions Srl
+# All Rights Reserved.
+
+
+from coriolis.osmorphing import rocky
+from coriolis.tests import test_base
+
+
+class BaseRockyLinuxMorphingToolsTestCase(test_base.CoriolisBaseTestCase):
+    """Test suite for the BaseRockyLinuxMorphingTools class."""
+
+    def test_check_os_supported(self):
+        detected_os_info = {
+            "distribution_name": rocky.ROCKY_LINUX_DISTRO_IDENTIFIER,
+            "release_version": "8"
+        }
+        result = rocky.BaseRockyLinuxMorphingTools.check_os_supported(
+            detected_os_info
+        )
+
+        self.assertTrue(result)
+
+    def test_check_os_not_supported(self):
+        detected_os_info = {
+            "distribution_name": "unsupported",
+        }
+        result = rocky.BaseRockyLinuxMorphingTools.check_os_supported(
+            detected_os_info
+        )
+
+        self.assertFalse(result)