Kaynağa Gözat

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

Signed-off-by: Mihaela Balutoiu <mbalutoiu@cloudbasesolutions.com>
Mihaela Balutoiu 2 yıl önce
ebeveyn
işleme
f21c11e005
1 değiştirilmiş dosya ile 26 ekleme ve 0 silme
  1. 26 0
      coriolis/tests/osmorphing/test_coreos.py

+ 26 - 0
coriolis/tests/osmorphing/test_coreos.py

@@ -0,0 +1,26 @@
+# Copyright 2024 Cloudbase Solutions Srl
+# All Rights Reserved.
+
+from coriolis.osmorphing import coreos
+from coriolis.osmorphing.osdetect import coreos as coreos_detect
+from coriolis.tests import test_base
+
+
+class BaseCoreOSMorphingToolsTestCase(test_base.CoriolisBaseTestCase):
+    """Test suite for the BaseCoreOSMorphingTools class."""
+
+    def test_check_os_supported(self):
+        detected_os_info = {
+            "distribution_name": coreos_detect.COREOS_DISTRO_IDENTIFIER
+        }
+        result = coreos.BaseCoreOSMorphingTools.check_os_supported(
+            detected_os_info)
+        self.assertTrue(result)
+
+    def test_check_os_not_supported(self):
+        detected_os_info = {
+            "distribution_name": "unsupported"
+        }
+        result = coreos.BaseCoreOSMorphingTools.check_os_supported(
+            detected_os_info)
+        self.assertFalse(result)