diff options
Diffstat (limited to '')
-rw-r--r-- | python/mozrelease/test/test_versions.py | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/python/mozrelease/test/test_versions.py b/python/mozrelease/test/test_versions.py index f3bca91f1f..eaf7d653db 100644 --- a/python/mozrelease/test/test_versions.py +++ b/python/mozrelease/test/test_versions.py @@ -1,7 +1,11 @@ import mozunit import pytest -from mozrelease.versions import MozillaVersion +from mozrelease.versions import ( + AncientMozillaVersion, + ModernMozillaVersion, + MozillaVersion, +) ALL_VERSIONS = [ # Keep this sorted "3.0", @@ -91,6 +95,21 @@ def test_versions_compare_greater(comparable_versions): assert MozillaVersion(larger_version) > MozillaVersion(smaller_version) +def test_ModernMozillaVersion(): + """Test properties specific to ModernMozillaVersion""" + assert isinstance(MozillaVersion("1.2.4"), ModernMozillaVersion) + assert isinstance(MozillaVersion("1.2.4rc3"), ModernMozillaVersion) + assert MozillaVersion("1.2rc3") == MozillaVersion("1.2.0rc3") + + +def test_AncientMozillaVersion(): + """Test properties specific to AncientMozillaVersion""" + assert isinstance(MozillaVersion("1.2.0.4"), AncientMozillaVersion) + assert isinstance(MozillaVersion("1.2.0.4pre1"), AncientMozillaVersion) + assert MozillaVersion("1.2pre1") == MozillaVersion("1.2.0pre1") + assert MozillaVersion("1.2.0.4pre1") == MozillaVersion("1.2.4pre1") + + @pytest.mark.parametrize("version", ALL_VERSIONS) def test_versions_compare_equal(version): """Test that versions properly compare as equal through multiple passes.""" |