[asterisk-commits] mjordan: testsuite/asterisk/trunk r3208 - /asterisk/trunk/lib/python/asterisk/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Apr 26 08:49:09 CDT 2012
Author: mjordan
Date: Thu Apr 26 08:49:04 2012
New Revision: 3208
URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=3208
Log:
Add support for Certified Asterisk branches
Revision 3205 added support for Certified Asterisk tags, but not for
the actual branch. Since the branch is based off of a particular tag
of Asterisk (e.g., 1.8.11), branch testing has to assume that the
capabilities mirror that of Asterisk 1.8.11.X, as opposed to the main
1.8 branch. This modifies the version parsing to treat SVN branches that
include a minor version (which all Certified Asterisk branches will have)
as a tag of that version for the purposes of min/max version checking.
Modified:
asterisk/trunk/lib/python/asterisk/version.py
Modified: asterisk/trunk/lib/python/asterisk/version.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/trunk/lib/python/asterisk/version.py?view=diff&rev=3208&r1=3207&r2=3208
==============================================================================
--- asterisk/trunk/lib/python/asterisk/version.py (original)
+++ asterisk/trunk/lib/python/asterisk/version.py Thu Apr 26 08:49:04 2012
@@ -53,7 +53,7 @@
if self.branch == "trunk":
res = 9999999999
elif self.branch[:6] == "branch":
- res = int(AsteriskVersion(self.branch[7:])) + 999999
+ res = int(AsteriskVersion(self.branch[7:]))
else:
# team branch XXX (may not be off of trunk)
res = 9999999999
@@ -68,6 +68,9 @@
res += self.patch
else:
res += int(self.__parse_version_patch(self.patch))
+ else:
+ # If no minor version, assume that this is a branch
+ res += 999999
return res
def __cmp__(self, other):
@@ -292,13 +295,19 @@
self.assertEqual(v.minor, "11")
self.assertEqual(v.patch, 1002)
+ def test_svn_version10(self):
+ v = AsteriskVersion("SVN-branch-1.8.11-r363674")
+ self.assertTrue(v.svn)
+ self.assertEqual(v.branch, "branch-1.8.11")
+ self.assertEqual(v.revision, "363674")
+
def test_cmp(self):
v1 = AsteriskVersion("1.4")
v2 = AsteriskVersion("1.6.0")
self.assertTrue(v1 < v2)
def test_cmp2(self):
- v1 = AsteriskVersion("1.4")
+ v1 = AsteriskVersion("1.4.0")
v2 = AsteriskVersion("1.4.15")
self.assertTrue(v1 < v2)
@@ -412,6 +421,26 @@
v2 = AsteriskVersion("1.8.15-cert1")
self.assertTrue(v1 < v2)
+ def test_cmp25(self):
+ v1 = AsteriskVersion("1.8.11-cert1")
+ v2 = AsteriskVersion("1.8.13.0")
+ self.assertTrue(v1 < v2)
+
+ def test_cmp26(self):
+ v1 = AsteriskVersion("SVN-branch-1.8.11-r363674")
+ v2 = AsteriskVersion("1.8.12.0")
+ self.assertTrue(v1 < v2)
+
+ def test_cmp26(self):
+ v1 = AsteriskVersion("SVN-branch-1.8.11-r363674")
+ v2 = AsteriskVersion("SVN-branch-1.8.15-r363674")
+ self.assertTrue(v1 < v2)
+
+ def test_cmp27(self):
+ v1 = AsteriskVersion("SVN-branch-1.8.11-r363674")
+ v2 = AsteriskVersion("SVN-branch-1.8-r369138M")
+ self.assertTrue(v1 < v2)
+
def main():
unittest.main()
More information about the asterisk-commits
mailing list