changeset 4015:6eec11b197aa

fix for indexer-test: Old version fails for me on Debian Etch with sqlite 2.8.17-2.
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Thu, 11 Sep 2008 18:48:07 +0000
parents b80224c1f4e3
children 96a5e0845adb
files test/test_indexer.py
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/test/test_indexer.py	Wed Sep 03 09:40:58 2008 +0000
+++ b/test/test_indexer.py	Thu Sep 11 18:48:07 2008 +0000
@@ -18,7 +18,7 @@
 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 # SOFTWARE.
 
-# $Id: test_indexer.py,v 1.11 2008-09-01 00:43:02 richard Exp $
+# $Id: test_indexer.py,v 1.12 2008-09-11 18:48:07 schlatterbeck Exp $
 
 import os, unittest, shutil
 
@@ -48,9 +48,14 @@
         self.dex.load_index()
 
     def assertSeqEqual(self, s1, s2):
-        # first argument is the db result we're testing, second is the desired result
-        # some db results don't have iterable rows, so we have to work around that
-        if [i for x,y in zip(s1, s2) for i,j in enumerate(y) if x[i] != j]:
+        # first argument is the db result we're testing, second is the
+        # desired result some db results don't have iterable rows, so we
+        # have to work around that
+        # Also work around some dbs not returning items in the expected
+        # order. This would be *so* much easier with python2.4's sorted.
+        s1 = list(s1)
+        s1.sort()
+        if s1 != s2:
             self.fail('contents of %r != %r'%(s1, s2))
 
     def test_basics(self):

Roundup Issue Tracker: http://roundup-tracker.org/