|
15 | 15 | # BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, |
16 | 16 | # SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. |
17 | 17 | # |
18 | | -# $Id: db_test_base.py,v 1.92 2007-10-26 06:52:26 richard Exp $ |
| 18 | +# $Id: db_test_base.py,v 1.93 2007-12-20 01:01:49 richard Exp $ |
19 | 19 |
|
20 | 20 | import unittest, os, shutil, errno, imp, sys, time, pprint, sets, base64, os.path |
21 | 21 |
|
@@ -1184,15 +1184,26 @@ def testFilteringRangeTwoSyntaxes(self): |
1184 | 1184 | ae(filt(None, {'deadline': '2003-02-16;'}), ['1', '3', '4']) |
1185 | 1185 |
|
1186 | 1186 | def testFilteringRangeYearMonthDay(self): |
1187 | | - ae, filt = self.filteringSetup() |
1188 | 1187 | ae(filt(None, {'deadline': '2002'}), []) |
1189 | 1188 | ae(filt(None, {'deadline': '2003'}), ['1', '2', '3']) |
1190 | 1189 | ae(filt(None, {'deadline': '2004'}), ['4']) |
1191 | | - ae(filt(None, {'deadline': '2003-02'}), ['1', '3']) |
1192 | | - ae(filt(None, {'deadline': '2003-03'}), []) |
1193 | 1190 | ae(filt(None, {'deadline': '2003-02-16'}), ['1']) |
1194 | 1191 | ae(filt(None, {'deadline': '2003-02-17'}), []) |
1195 | 1192 |
|
| 1193 | + def testFilteringRangeMonths(self): |
| 1194 | + ae, filt = self.filteringSetup() |
| 1195 | + for month in range(1, 5): #13): |
| 1196 | + print 'MONTH', month |
| 1197 | + for n in range(1, month+1): |
| 1198 | + i = self.db.issue.create(title='%d.%d'%(month, n), |
| 1199 | + deadline=date.Date('2004-%02d-%02d.00:00'%(month, n))) |
| 1200 | + print 'CREATE', i, self.db.issue.get(i, 'deadline') |
| 1201 | + self.db.commit() |
| 1202 | + |
| 1203 | + for month in range(1, 13): |
| 1204 | + r = filt(None, dict(deadline='2004-%02d'%month)) |
| 1205 | + assert len(r) == month, 'month %d != length %d'%(month, len(r)) |
| 1206 | + |
1196 | 1207 | def testFilteringRangeInterval(self): |
1197 | 1208 | ae, filt = self.filteringSetup() |
1198 | 1209 | ae(filt(None, {'foo': 'from 0:50 to 2:00'}), ['1']) |
|
0 commit comments