Mercurial > p > roundup > code
diff test/db_test_base.py @ 2418:89072e66b5f5
fixed filtering by floats in anydbm [SF#963584]
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 09 Jun 2004 06:35:45 +0000 |
| parents | 5fd066bcf9cf |
| children | 0e2a0c2c8142 |
line wrap: on
line diff
--- a/test/db_test_base.py Wed Jun 09 06:13:52 2004 +0000 +++ b/test/db_test_base.py Wed Jun 09 06:35:45 2004 +0000 @@ -15,7 +15,7 @@ # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. # -# $Id: db_test_base.py,v 1.29 2004-06-08 05:35:07 richard Exp $ +# $Id: db_test_base.py,v 1.30 2004-06-09 06:35:45 richard Exp $ import unittest, os, shutil, errno, imp, sys, time, pprint @@ -813,9 +813,9 @@ def filteringSetup(self): for user in ( - {'username': 'bleep'}, - {'username': 'blop'}, - {'username': 'blorp'}): + {'username': 'bleep', 'age': 1}, + {'username': 'blop', 'age': 1.5}, + {'username': 'blorp', 'age': 2}): self.db.user.create(**user) iss = self.db.issue for issue in ( @@ -840,6 +840,13 @@ ae(filt(None, {'id': '2'}, ('+','id'), (None,None)), ['2']) ae(filt(None, {'id': '10'}, ('+','id'), (None,None)), []) + def testFilteringNumber(self): + self.filteringSetup() + ae, filt = self.assertEqual, self.db.user.filter + ae(filt(None, {'age': '1'}, ('+','id'), (None,None)), ['3']) + ae(filt(None, {'age': '1.5'}, ('+','id'), (None,None)), ['4']) + ae(filt(None, {'age': '2'}, ('+','id'), (None,None)), ['5']) + def testFilteringString(self): ae, filt = self.filteringSetup() ae(filt(None, {'title': ['one']}, ('+','id'), (None,None)), ['1'])
