diff --git a/tests/common/test_imcversion.py b/tests/common/test_imcversion.py index 0b835bd1..1b7764dc 100644 --- a/tests/common/test_imcversion.py +++ b/tests/common/test_imcversion.py @@ -40,9 +40,10 @@ def test_nightly_version2(): def test_nightly_version3(): + # 2.0(2cS6) will be considered as 2.0(2d) internally version1 = ImcVersion("2.0(2cS6)") version2 = ImcVersion("2.0(2c)") - assert_equal((version1 == version2), True) + assert_equal((version1 == version2), False) def test_nightly_version4(): @@ -51,6 +52,41 @@ def test_nightly_version4(): assert_equal((version1 < version2), True) +def test_spin_version1(): + # version interpreted as 4.0(2b) + version1 = ImcVersion("4.0(2aS3)") + version2 = ImcVersion("4.0(2b)") + assert_equal((version1 == version2), True) + + +def test_spin_version2(): + # version interpreted as 4.0(234c) + version1 = ImcVersion("4.0(234bS3)") + version2 = ImcVersion("4.0(234c)") + assert_equal((version1 == version2), True) + + +def test_spin_version3(): + # version interpreted as 4.0(2z) + version1 = ImcVersion("4.0(2S3)") + version2 = ImcVersion("4.0(2z)") + assert_equal((version1 == version2), True) + + +def test_spin_version4(): + # version interpreted as 4.0(234z) + version1 = ImcVersion("4.0(234S3)") + version2 = ImcVersion("4.0(234z)") + assert_equal((version1 == version2), True) + + +def test_patch_version1(): + # version interpreted as 4.0(235a) + version1 = ImcVersion("4.0(234.5)") + version2 = ImcVersion("4.0(235a)") + assert_equal((version1 == version2), True) + + def test_gt_same_major_version(): version1 = VersionMeta.Version151f version2 = VersionMeta.Version151x @@ -64,9 +100,11 @@ def test_gt_different_major_version(): def test_patch_versions(): + # when we don't see a patch version we use z + # so 2.0(12) will be considerde as 2.0(12z) version1 = ImcVersion("2.0(12b)") version2 = ImcVersion("2.0(12)") - assert_equal((version1 > version2), True) + assert_equal((version1 > version2), False) def test_handle_version():