changeset 4999:b73ced174002

Xapian2009: test_title_search_simple is now generative test.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Tue, 11 Aug 2009 23:48:51 +0200
parents d0c9c13dbeda
children 52f2454de7ab
files MoinMoin/search/_tests/test_search.py
diffstat 1 files changed, 8 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/_tests/test_search.py	Tue Aug 11 23:38:09 2009 +0200
+++ b/MoinMoin/search/_tests/test_search.py	Tue Aug 11 23:48:51 2009 +0200
@@ -113,14 +113,16 @@
         return self.get_searcher(query).run()
 
     def test_title_search_simple(self):
-        result = self.search(u'title:SearchTestPage')
-        assert len(result.hits) == 1
+        searches = {'title:SearchTestPage': 1,
+                    'title:LanguageSetup': 1,
+                    'title:SearchTestNotExisting': 0}
 
-        result = self.search(u'title:LanguageSetup')
-        assert len(result.hits) == 1
+        def test(query, res_count):
+            result = self.search(query)
+            assert len(result.hits) == res_count
 
-        result = self.search(u'title:SearchTestNotExisting')
-        assert not result.hits
+        for query, res_count in searches.iteritems():
+            yield query, test, query, res_count
 
     def test_title_search_re(self):
         result = self.search(ur'title:re:\bSearchTest')