[tor-commits] [stem/master] Including common tag comparisons in version unit tests
atagar at torproject.org
atagar at torproject.org
Mon Jul 23 17:11:45 UTC 2012
commit e4699ba9545a99ec58b7d211dc7bff8d236fbb8e
Author: Damian Johnson <atagar at torproject.org>
Date: Mon Jul 23 10:04:23 2012 -0700
Including common tag comparisons in version unit tests
---
stem/version.py | 4 ----
test/unit/version.py | 4 ++++
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/stem/version.py b/stem/version.py
index 130ca1c..08f5ca2 100644
--- a/stem/version.py
+++ b/stem/version.py
@@ -110,10 +110,6 @@ class Version(object):
# The patch and status matches are optional (may be None) and have an extra
# proceeding period or dash if they exist. Stripping those off.
- # TODO: The 'extra' attribute isn't technically part of the spec yet, but
- # it's useful and I'm trying to add it...
- # https://trac.torproject.org/6445
-
if patch: patch = int(patch[1:])
if status: status = status[1:]
if extra: extra = extra[2:-1]
diff --git a/test/unit/version.py b/test/unit/version.py
index f32fb7a..0ff39dd 100644
--- a/test/unit/version.py
+++ b/test/unit/version.py
@@ -97,6 +97,10 @@ class TestVersion(unittest.TestCase):
self.assert_version_is_greater("0.1.2.3-ugg", "0.1.2.3-tag")
self.assert_version_is_equal("0.1.2.3-tag", "0.1.2.3-tag")
+ # check with common tags
+ self.assert_version_is_greater("0.1.2.3-beta", "0.1.2.3-alpha")
+ self.assert_version_is_greater("0.1.2.3-rc", "0.1.2.3-beta")
+
# checks that a missing patch level equals zero
self.assert_version_is_equal("0.1.2", "0.1.2.0")
self.assert_version_is_equal("0.1.2-tag", "0.1.2.0-tag")
More information about the tor-commits
mailing list