joey: thuban/Extensions/wms/test test_parser.py,1.18,1.19

cvs@intevation.de cvs at intevation.de
Mon Oct 4 18:40:58 CEST 2004


Author: joey

Update of /thubanrepository/thuban/Extensions/wms/test
In directory doto:/tmp/cvs-serv4180

Modified Files:
	test_parser.py 
Log Message:
Added missing self-test

Index: test_parser.py
===================================================================
RCS file: /thubanrepository/thuban/Extensions/wms/test/test_parser.py,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- test_parser.py	13 Apr 2004 17:17:40 -0000	1.18
+++ test_parser.py	4 Oct 2004 16:40:56 -0000	1.19
@@ -95,6 +95,52 @@
             self.grok(xml)
 
 
+    def test_compareLists(self):
+        """
+        Test the internal compareLists method.
+        """
+
+        # Equality of empty lists
+        self.compareLists([], [])
+
+        # Equality of equal lists
+        self.compareLists([1,2], [1,2])
+
+        # Equality of permuted lists
+        self.compareLists([1,2], [2,1])
+
+        # Equality of large permuted lists
+        self.compareLists([1,2,3,4,5,6,7,8], [8,3,1,2,5,7,4,6])
+
+        # TODO: Check if non-equality raises an exception:
+        #
+        # [a,b] != [c,b,a]
+        # [a,b] != [c,b]
+        # [] = []
+        # [] != [a]
+
+
+    def test_compareDicts(self):
+        """
+        Test the internal compareDicts method.
+        """
+
+        # Equality of empty dictionaries
+        self.compareDicts({}, {})
+
+        # Equality of equal dictionaries
+        # Python may represent the dictionaries differently
+        self.compareDicts({10:20, 11:30}, {10:20, 11:30})
+                        
+        # Equality of permuted dictionaries
+        # Python may represent the dictionaries similar anyway
+        self.compareDicts({10:20, 11:30}, {11:30, 10:20})
+                        
+        # TODO: Check if non-equality raises an exception:
+        #
+        # {a:b, b:c} != {a:b}
+
+
     def test_general(self):
         """
         Test general attributes extracted from Capabilities XML





More information about the Thuban-devel mailing list

This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)