fix automatic test: ensure we actually have
authorLaure Bourgois <Laure.Bourgois@logilab.fr>
Wed, 04 Mar 2009 16:53:10 +0100
changeset 1004 625e59773119
parent 1003 be21d3d31ecf
child 1006 92a0601b2523
child 1015 b5fdad9208f8
child 1017 1a8442f3d63a
child 1075 19fe9184a8bb
fix automatic test: ensure we actually have rset of the expected size (1 or 10)
devtools/testlib.py
--- a/devtools/testlib.py	Wed Mar 04 13:25:51 2009 +0100
+++ b/devtools/testlib.py	Wed Mar 04 16:53:10 2009 +0100
@@ -256,11 +256,11 @@
     def to_test_etypes(self):
         return unprotected_entities(self.schema, strict=True)
     
-    def iter_automatic_rsets(self):
+    def iter_automatic_rsets(self, limit=10):
         """generates basic resultsets for each entity type"""
         etypes = self.to_test_etypes()
         for etype in etypes:
-            yield self.execute('Any X WHERE X is %s' % etype)
+            yield self.execute('Any X LIMIT %s WHERE X is %s' % (limit, etype))
 
         etype1 = etypes.pop()
         etype2 = etypes.pop()
@@ -355,14 +355,14 @@
     ## one each
     def test_one_each_config(self):
         self.auto_populate(1)
-        for rset in self.iter_automatic_rsets():
+        for rset in self.iter_automatic_rsets(limit=1):
             for testargs in self._test_everything_for(rset):
                 yield testargs
 
     ## ten each
     def test_ten_each_config(self):
         self.auto_populate(10)
-        for rset in self.iter_automatic_rsets():
+        for rset in self.iter_automatic_rsets(limit=10):
             for testargs in self._test_everything_for(rset):
                 yield testargs