コード例 #1
0
ファイル: test_rhel_version.py プロジェクト: tlegen-k/adviser
    def test_version_no_change_no_os_match(self) -> None:
        """Test no change to RHEL version identifier if OS does not match."""
        context = flexmock(project=Project.from_strings(self._CASE_PIPFILE))
        context.project.runtime_environment.operating_system.name = "fedora"
        context.project.runtime_environment.operating_system.version = "31"

        boot = RHELVersionBoot()
        with RHELVersionBoot.assigned_context(context):
            boot.run()

        assert context.project.runtime_environment.operating_system.name == "fedora"
        assert context.project.runtime_environment.operating_system.version == "31"
コード例 #2
0
ファイル: test_rhel_version.py プロジェクト: tlegen-k/adviser
    def test_version_no_change_no_version(self) -> None:
        """Test no change to RHEL version identifier if OS version was not supplied."""
        context = flexmock(project=Project.from_strings(self._CASE_PIPFILE))
        context.project.runtime_environment.operating_system.name = "rhel"
        context.project.runtime_environment.operating_system.version = None

        boot = RHELVersionBoot()
        with RHELVersionBoot.assigned_context(context):
            boot.run()

        assert context.project.runtime_environment.operating_system.name == "rhel"
        assert context.project.runtime_environment.operating_system.version is None
コード例 #3
0
ファイル: test_rhel_version.py プロジェクト: tlegen-k/adviser
    def test_version_change(self) -> None:
        """Test changing RHEL version to its major version."""
        context = flexmock(project=Project.from_strings(self._CASE_PIPFILE))
        context.project.runtime_environment.operating_system.name = "rhel"
        context.project.runtime_environment.operating_system.version = "8.1"

        boot = RHELVersionBoot()
        with RHELVersionBoot.assigned_context(context):
            boot.run()

        assert context.project.runtime_environment.operating_system.name == "rhel"
        assert context.project.runtime_environment.operating_system.version == "8"