changeset 4978:0b5aaec043cd

Xapian2009: Tests for mimetype, language and domain. Test classes are new style classes.
author Dmitrijs Milajevs <dimazest@gmail.com>
date Thu, 06 Aug 2009 16:19:52 +0200
parents 2171281b6d79
children d2cda24a5475
files MoinMoin/search/_tests/test_search.py
diffstat 1 files changed, 13 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/search/_tests/test_search.py	Wed Aug 05 21:33:38 2009 +0200
+++ b/MoinMoin/search/_tests/test_search.py	Thu Aug 06 16:19:52 2009 +0200
@@ -17,7 +17,7 @@
 from MoinMoin._tests import nuke_xapian_index, wikiconfig
 
 
-class TestQueryParsing:
+class TestQueryParsing(object):
     """ search: query parser tests """
 
     def testQueryParser(self):
@@ -72,7 +72,7 @@
             yield _test, query
 
 
-class TestSearch:
+class TestSearch(object):
     """ search: test search """
     doesnotexist = u'jfhsdaASDLASKDJ'
 
@@ -106,6 +106,15 @@
             for test in [simple_test, re_test, case_test, case_re_test]:
                 yield '%s %s' % (prefix, test.func_name), test, prefix, term
 
+        for prefix, term in [('mimetype', 'text/text')]:
+            for test in [simple_test, re_test]:
+                yield '%s %s' % (prefix, test.func_name), test, prefix, term
+
+        for prefix, term in [('language', 'en'), ('domain', 'system')]:
+            for test in [simple_test]:
+                yield '%s %s' % (prefix, test.func_name), test, prefix, term
+
+
     def testTitleSearchAND(self):
         """ search: title search with AND expression """
         result = search.searchPages(self.request, u"title:Help title:Index")
@@ -147,7 +156,7 @@
         result = search.searchPages(self.request, query, sort='page_name')
 
 
-class TestXapianIndex(TestSearch):
+class TestXapianSearch(TestSearch):
     """ search: test Xapian indexing """
     # XXX skip it if xapian is not available
 
@@ -166,7 +175,7 @@
         nuke_xapian_index(self.request)
 
 
-class TestXapianInNewThread(object):
+class TestXapianIndexingInNewThread(object):
     """ search: test Xapian indexing """
     # XXX skip it if xapian is not available