From 763cc6eaee612d803815a5eea28b95c39f6dce48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20Araujo?= Date: Wed, 5 Oct 2011 01:41:14 +0200 Subject: [PATCH] Add tests for comparing candidate and final versions in packaging (#11841). MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This used to be buggy; Filip GruszczyƄski contributed tests and a code patch but the latter is not needed. --- Lib/packaging/tests/test_version.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Lib/packaging/tests/test_version.py b/Lib/packaging/tests/test_version.py index f94c8001145..54a9e7a2399 100644 --- a/Lib/packaging/tests/test_version.py +++ b/Lib/packaging/tests/test_version.py @@ -101,8 +101,18 @@ class VersionTestCase(unittest.TestCase): True >>> V('1.2.0') >= V('1.2.3') False + >>> V('1.2.0rc1') >= V('1.2.0') + False >>> (V('1.0') > V('1.0b2')) True + >>> V('1.0') > V('1.0c2') + True + >>> V('1.0') > V('1.0rc2') + True + >>> V('1.0rc2') > V('1.0rc1') + True + >>> V('1.0c4') > V('1.0c1') + True >>> (V('1.0') > V('1.0c2') > V('1.0c1') > V('1.0b2') > V('1.0b1') ... > V('1.0a2') > V('1.0a1')) True @@ -129,6 +139,8 @@ class VersionTestCase(unittest.TestCase): ... < V('1.0.dev18') ... < V('1.0.dev456') ... < V('1.0.dev1234') + ... < V('1.0rc1') + ... < V('1.0rc2') ... < V('1.0') ... < V('1.0.post456.dev623') # development version of a post release ... < V('1.0.post456'))