[asterisk-commits] pabelanger: branch pabelanger/sipp r1100 - /asterisk/team/pabelanger/sipp/lib...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Dec 7 14:34:41 CST 2010


Author: pabelanger
Date: Tue Dec  7 14:34:37 2010
New Revision: 1100

URL: http://svnview.digium.com/svn/testsuite?view=rev&rev=1100
Log:
Even MOAR unit tests

Modified:
    asterisk/team/pabelanger/sipp/lib/python/sipp/version.py

Modified: asterisk/team/pabelanger/sipp/lib/python/sipp/version.py
URL: http://svnview.digium.com/svn/testsuite/asterisk/team/pabelanger/sipp/lib/python/sipp/version.py?view=diff&rev=1100&r1=1099&r2=1100
==============================================================================
--- asterisk/team/pabelanger/sipp/lib/python/sipp/version.py (original)
+++ asterisk/team/pabelanger/sipp/lib/python/sipp/version.py Tue Dec  7 14:34:37 2010
@@ -71,6 +71,21 @@
         res = cmp(int(self), int(other))
         return res
 
+    def __ne__(self, other):
+        res = self.__cmp__(other)
+        if res == 0 and (self.tls or self.pcap or other.tls or other.pcap):
+            if (self.tls == other.pcap) or (self.pcap == other.tls):
+                return True
+            return False
+        return res
+
+    def __eq__(self, other):
+        res = self.__cmp__(other)
+        if res == 0:
+            if (self.tls == other.tls) or (self.pcap == other.pcap):
+                return True
+            return False
+
     def __parse_version(self):
         self.svn = False
         self.tls = False
@@ -164,51 +179,66 @@
         self.assertTrue(v1 == v2)
 
     def test_cmp4(self):
+        v1 = SIPpVersion("v3.1")
+        v2 = SIPpVersion("v3.1")
+        self.assertFalse(v1 != v2)
+
+    def test_cmp5(self):
         v1 = SIPpVersion("v3.1-TLS")
         v2 = SIPpVersion("v3.1-TLS")
         self.assertTrue(v1 == v2)
 
-    def test_cmp5(self):
+    def test_cmp6(self):
         v1 = SIPpVersion("v2.0.1")
         v2 = SIPpVersion("v2.0.1")
         self.assertTrue(v1 == v2)
 
-    def test_cmp6(self):
+    def test_cmp7(self):
+        v1 = SIPpVersion("v3.2-TLS")
+        v2 = SIPpVersion("v3.2-PCAP")
+        self.assertTrue(v1 != v2)
+
+    def test_cmp8(self):
+        v1 = SIPpVersion("v3.2-TLS")
+        v2 = SIPpVersion("v3.2-PCAP")
+        self.assertFalse(v1 == v2)
+
+    def test_cmp9(self):
         v1 = SIPpVersion("v3.2-TLS-PCAP")
         v2 = SIPpVersion("v3.2-TLS")
         self.assertTrue(v1 > v2)
 
-    def test_cmp7(self):
+    def test_cmp10(self):
         v1 = SIPpVersion("v3.2-TLS-PCAP")
         v2 = SIPpVersion("v3.2-PCAP")
         self.assertTrue(v1 > v2)
 
-    def test_cmp8(self):
+    def test_cmp11(self):
+        v1 = SIPpVersion("v3.2-TLS-PCAP")
+        v2 = SIPpVersion("v3.2-TLS")
+        self.assertTrue(v1 != v2)
+
+    def test_cmp12(self):
         v1 = SIPpVersion("v3.2-TLS-PCAP")
         v2 = SIPpVersion("v3.2-TLS")
         self.assertFalse(v1 == v2)
 
-    def test_cmp9(self):
+    def test_cmp13(self):
         v1 = SIPpVersion("v3.2-TLS-PCAP")
         v2 = SIPpVersion("v2.0.1-PCAP")
         self.assertTrue(v1 > v2)
 
-    def test_cmp10(self):
+    def test_cmp14(self):
         v1 = SIPpVersion("v3.1-TLS")
         v2 = SIPpVersion("v3.1-PCAP")
         self.assertFalse(v1 > v2)
 
-    def test_cmp11(self):
+    def test_cmp15(self):
         v1 = SIPpVersion("v3.1-TLS")
         v2 = SIPpVersion("v3.1-PCAP")
         self.assertFalse(v1 < v2)
 
-    def test_cmp12(self):
-        v1 = SIPpVersion("v3.2-TLS")
-        v2 = SIPpVersion("v2.0.1-TLS-PCAP")
-        self.assertTrue(v1 > v2)
-
-    def test_cmp13(self):
+    def test_cmp16(self):
         v1 = SIPpVersion("v3.2-TLS")
         v2 = SIPpVersion("v3.1-TLS-PCAP")
         self.assertTrue(v1 > v2)




More information about the asterisk-commits mailing list