[asterisk-commits] mnicholson: testsuite/asterisk/trunk r1773 - /asterisk/trunk/lib/python/aster...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 21 13:04:51 CDT 2011


Author: mnicholson
Date: Thu Jul 21 13:04:47 2011
New Revision: 1773

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1773
Log:
added unit tests for asterisk 10 version number parsing

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=1773&r1=1772&r2=1773
==============================================================================
--- asterisk/trunk/lib/python/asterisk/version.py (original)
+++ asterisk/trunk/lib/python/asterisk/version.py Thu Jul 21 13:04:47 2011
@@ -148,6 +148,19 @@
         self.assertEqual(v.concept, "1")
         self.assertEqual(v.major, "4")
 
+    def test_version4(self):
+        v = AsteriskVersion("10.0")
+        self.assertFalse(v.svn)
+        self.assertEqual(str(v), "10.0")
+        self.assertEqual(v.concept, "10")
+        self.assertEqual(v.major, "0")
+
+    def test_version5(self):
+        v = AsteriskVersion("10")
+        self.assertFalse(v.svn)
+        self.assertEqual(str(v), "10")
+        self.assertEqual(v.concept, "10")
+
     def test_svn_version(self):
         v = AsteriskVersion("SVN-trunk-r252849")
         self.assertTrue(v.svn)
@@ -177,6 +190,13 @@
         self.assertEqual(v.branch, "russell-rest")
         self.assertEqual(v.revision, "12345")
 
+    def test_svn_version5(self):
+        v = AsteriskVersion("SVN-branch-10-r12345")
+        self.assertTrue(v.svn)
+        self.assertEqual(str(v), "SVN-branch-10-r12345")
+        self.assertEqual(v.branch, "branch-10")
+        self.assertEqual(v.revision, "12345")
+
     def test_cmp(self):
         v1 = AsteriskVersion("1.4")
         v2 = AsteriskVersion("1.6.0")
@@ -232,6 +252,20 @@
         v2 = AsteriskVersion("SVN-branch-1.6.1-r245581M")
         self.assertTrue(v1 > v2)
 
+    def test_cmp12(self):
+        v1 = AsteriskVersion("SVN-branch-10-r245581M")
+        v2 = AsteriskVersion("SVN-branch-1.6.1-r245581M")
+        self.assertTrue(v1 > v2)
+
+    def test_cmp13(self):
+        v1 = AsteriskVersion("10.0")
+        v2 = AsteriskVersion("1.8")
+        self.assertTrue(v1 > v2)
+
+    def test_cmp14(self):
+        v1 = AsteriskVersion("10")
+        v2 = AsteriskVersion("1.8")
+        self.assertTrue(v1 > v2)
 
 def main():
     unittest.main()




More information about the asterisk-commits mailing list