From 5f12b2be9afaa6f9b1ddc9faf6bf217852659f27 Mon Sep 17 00:00:00 2001 From: Mihaela Balutoiu Date: Fri, 22 Mar 2024 19:10:04 +0200 Subject: [PATCH] Add unit tests for `osmorphing.amazon.py` module Signed-off-by: Mihaela Balutoiu --- coriolis/tests/osmorphing/test_amazon.py | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 coriolis/tests/osmorphing/test_amazon.py diff --git a/coriolis/tests/osmorphing/test_amazon.py b/coriolis/tests/osmorphing/test_amazon.py new file mode 100644 index 00000000..5ac604c8 --- /dev/null +++ b/coriolis/tests/osmorphing/test_amazon.py @@ -0,0 +1,30 @@ +# Copyright 2024 Cloudbase Solutions Srl +# All Rights Reserved. + + +from coriolis.osmorphing import amazon +from coriolis.tests import test_base + + +class BaseAmazonLinuxOSMorphingToolsTestCase(test_base.CoriolisBaseTestCase): + """Test suite for the BaseAmazonLinuxOSMorphingTools class.""" + + def test_check_os_supported(self): + detected_os_info = { + "distribution_name": amazon.AMAZON_DISTRO_NAME_IDENTIFIER, + "release_version": "2" + } + + result = amazon.BaseAmazonLinuxOSMorphingTools.check_os_supported( + detected_os_info) + + self.assertTrue(result) + + def test_check_os_not_supported(self): + detected_os_info = { + "distribution_name": 'unsupported', + } + result = amazon.BaseAmazonLinuxOSMorphingTools.check_os_supported( + detected_os_info) + + self.assertFalse(result)