[Zope3-checkins] CVS: Zope3/src/zope/app/catalog/tests - test_catalog.py:1.1.2.2
Anthony Baxter
anthony@interlink.com.au
Sat, 12 Jul 2003 23:13:21 -0400
Update of /cvs-repository/Zope3/src/zope/app/catalog/tests
In directory cvs.zope.org:/tmp/cvs-serv31466/tests
Modified Files:
Tag: melb-2003-content-catalog-branch
test_catalog.py
Log Message:
ResultSet is now a class that implements the __iter__ protocol (and __len__).
It still does 'lazy loading' of the objects - if you get back 24,000 objects
and only load the first 20, the rest aren't brought into memory.
minor changes to test suite to match this.
=== Zope3/src/zope/app/catalog/tests/test_catalog.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/src/zope/app/catalog/tests/test_catalog.py:1.1.2.1 Sat Jul 12 22:55:09 2003
+++ Zope3/src/zope/app/catalog/tests/test_catalog.py Sat Jul 12 23:13:16 2003
@@ -176,15 +176,12 @@
self.assertEqual(len(names), 2)
self.assertEqual(names, ['bonobo', 'monkey'])
res = catalog.searchResults(simiantype='punyhuman', name='anthony')
- res = list(res)
self.assertEqual(len(res), 1)
- ob = res[0]
+ ob = iter(res).next()
self.assertEqual((ob.name,ob.simiantype), ('anthony', 'punyhuman'))
res = catalog.searchResults(simiantype='ape', name='bobo')
- res = list(res)
self.assertEqual(len(res), 0)
res = catalog.searchResults(simiantype='ape', name='mwumi')
- res = list(res)
self.assertEqual(len(res), 0)
self.assertRaises(ValueError, catalog.searchResults,
simiantype='monkey', hat='beret')