Procházet zdrojové kódy

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

Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Mihaela Balutoiu před 2 roky
rodič
revize
6e8ff9e3ed
1 změnil soubory, kde provedl 30 přidání a 0 odebrání
  1. 30 0
      coriolis/tests/osmorphing/test_centos.py

+ 30 - 0
coriolis/tests/osmorphing/test_centos.py

@@ -0,0 +1,30 @@
+# Copyright 2024 Cloudbase Solutions Srl
+# All Rights Reserved.
+
+
+from coriolis.osmorphing import centos
+from coriolis.tests import test_base
+
+
+class BaseCentOSMorphingToolsTestCase(test_base.CoriolisBaseTestCase):
+    """Test suite for the BaseCentOSMorphingTools class."""
+
+    def test_check_os_supported(self):
+        detected_os_info = {
+            "distribution_name": centos.CENTOS_DISTRO_IDENTIFIER,
+            "release_version": "6"
+        }
+
+        result = centos.BaseCentOSMorphingTools.check_os_supported(
+            detected_os_info)
+
+        self.assertTrue(result)
+
+    def test_check_os_not_supported(self):
+        detected_os_info = {
+            "distribution_name": 'unsupported',
+        }
+        result = centos.BaseCentOSMorphingTools.check_os_supported(
+            detected_os_info)
+
+        self.assertFalse(result)