Mercurial > p > roundup > code
comparison test/db_test_base.py @ 2453:0e2a0c2c8142
allow list of values for id, Number and Boolean filtering in anydbm backend
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Sun, 13 Jun 2004 01:05:46 +0000 |
| parents | 89072e66b5f5 |
| children | f41539b3c486 |
comparison
equal
deleted
inserted
replaced
| 2450:c45ed2413044 | 2453:0e2a0c2c8142 |
|---|---|
| 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | 13 # BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" | 14 # FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" |
| 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, | 15 # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
| 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. | 16 # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
| 17 # | 17 # |
| 18 # $Id: db_test_base.py,v 1.30 2004-06-09 06:35:45 richard Exp $ | 18 # $Id: db_test_base.py,v 1.31 2004-06-13 01:05:46 richard Exp $ |
| 19 | 19 |
| 20 import unittest, os, shutil, errno, imp, sys, time, pprint | 20 import unittest, os, shutil, errno, imp, sys, time, pprint |
| 21 | 21 |
| 22 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ | 22 from roundup.hyperdb import String, Password, Link, Multilink, Date, \ |
| 23 Interval, DatabaseError, Boolean, Number, Node | 23 Interval, DatabaseError, Boolean, Number, Node |
| 844 self.filteringSetup() | 844 self.filteringSetup() |
| 845 ae, filt = self.assertEqual, self.db.user.filter | 845 ae, filt = self.assertEqual, self.db.user.filter |
| 846 ae(filt(None, {'age': '1'}, ('+','id'), (None,None)), ['3']) | 846 ae(filt(None, {'age': '1'}, ('+','id'), (None,None)), ['3']) |
| 847 ae(filt(None, {'age': '1.5'}, ('+','id'), (None,None)), ['4']) | 847 ae(filt(None, {'age': '1.5'}, ('+','id'), (None,None)), ['4']) |
| 848 ae(filt(None, {'age': '2'}, ('+','id'), (None,None)), ['5']) | 848 ae(filt(None, {'age': '2'}, ('+','id'), (None,None)), ['5']) |
| 849 ae(filt(None, {'age': ['1','2']}, ('+','id'), (None,None)), ['3','5']) | |
| 849 | 850 |
| 850 def testFilteringString(self): | 851 def testFilteringString(self): |
| 851 ae, filt = self.filteringSetup() | 852 ae, filt = self.filteringSetup() |
| 852 ae(filt(None, {'title': ['one']}, ('+','id'), (None,None)), ['1']) | 853 ae(filt(None, {'title': ['one']}, ('+','id'), (None,None)), ['1']) |
| 853 ae(filt(None, {'title': ['issue']}, ('+','id'), (None,None)), | 854 ae(filt(None, {'title': ['issue']}, ('+','id'), (None,None)), |
