"""test version check schedule."""
import pytest
from mindformers.tools.utils import is_version_le, is_version_ge
@pytest.mark.level0
@pytest.mark.platform_x86_cpu
@pytest.mark.env_onecard
def test_check_is_version_ge():
"""
Feature: IsVersionGreaterEqual
Description: Test IsVersionGreaterEqual
Expectation: ValueError
"""
assert is_version_ge("2.0.0rc1", '1.8.0')
assert is_version_ge("1.8.1", '1.8.0')
assert is_version_ge("1.8.0", '1.8.0')
assert is_version_ge("2.0.0rc1", '2.0.0')
assert not is_version_ge("1.8.0", '1.10.0')
@pytest.mark.level0
@pytest.mark.platform_x86_cpu
@pytest.mark.env_onecard
def test_check_is_version_le():
"""
Feature: IsVersionLessEqual
Description: Test IsVersionLessEqual
Expectation: ValueError
"""
assert is_version_le("2.0.0rc1", '2.0.0')
assert is_version_le("1.8.1", '2.0.0')
assert is_version_le("1.8.0", '2.0.0rc1')