Mercurial > p > roundup > code
comparison test/db_test_base.py @ 3635:53987aa153d2
Transitive-property support.
- Fixed some of the pet-peeves from pep8
- Better parameter names for new _subselect method
- use new-style class for support.Proptree but needed a new-style class
for the property I introduced anyway.
- Fix a bug where searching did the wrong thing (interestingly enough
the same wrong thing for all backends): A search for
{'messages': ['1'], 'messages.author': ['2']}
would ignore the 'messages' part (messages being non-leaf node in
proptree). Fixed and added a regression test for this.
- Added the transitive searching to the SearchAction. New method
get_transitive_prop introduced in hyperdb that does the transitive
version of getprops()[name]. Fixed two tests to use the (faked) method
instead of getprop.
Now searching for transitive props via the web-interface works for me.
Thanks to alexander smishlajev for pointing me at the coding style.
Sorry for stepping on the peeves -- I'm using a different coding style
in most other projects I'm doing ...
| author | Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net> |
|---|---|
| date | Thu, 13 Jul 2006 10:14:56 +0000 |
| parents | 57c66056ffe4 |
| children | fa7becc62534 |
comparison
equal
deleted
inserted
replaced
| 3634:57c66056ffe4 | 3635:53987aa153d2 |
|---|---|
| 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.70 2006-07-08 18:28:18 schlatterbeck Exp $ | 18 # $Id: db_test_base.py,v 1.71 2006-07-13 10:14:56 schlatterbeck Exp $ |
| 19 | 19 |
| 20 import unittest, os, shutil, errno, imp, sys, time, pprint, sets | 20 import unittest, os, shutil, errno, imp, sys, time, pprint, sets |
| 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 |
| 1189 ae(filt(None, {'messages.author': ['8', '9', '10'], | 1189 ae(filt(None, {'messages.author': ['8', '9', '10'], |
| 1190 'messages.date': '2006-01-07.21:00;2006-01-10'}, ('+','id')), | 1190 'messages.date': '2006-01-07.21:00;2006-01-10'}, ('+','id')), |
| 1191 ['6', '7', '8']) | 1191 ['6', '7', '8']) |
| 1192 ae(filt(None, {'nosy.supervisor.username': 'ceo'}, | 1192 ae(filt(None, {'nosy.supervisor.username': 'ceo'}, |
| 1193 ('+','id')), ['1', '2']) | 1193 ('+','id')), ['1', '2']) |
| 1194 ae(filt(None, {'messages.author': ['6', '9']}, | |
| 1195 ('+','id')), ['1', '2', '5', '8']) | |
| 1196 ae(filt(None, {'messages': ['5', '7']}, | |
| 1197 ('+','id')), ['3', '5', '8']) | |
| 1198 ae(filt(None, {'messages.author': ['6', '9'], 'messages': ['5', '7']}, | |
| 1199 ('+','id')), ['5', '8']) | |
| 1194 | 1200 |
| 1195 # XXX add sorting tests for other types | 1201 # XXX add sorting tests for other types |
| 1196 # XXX test auditors and reactors | 1202 # XXX test auditors and reactors |
| 1197 | 1203 |
| 1198 def testImportExport(self): | 1204 def testImportExport(self): |
