Skip to content

Commit 79318d4

Browse files
author
Richard Jones
committed
test fixes and checking of indexer overwrites (xapian currently fails)
1 parent bb0ecd4 commit 79318d4

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

test/db_test_base.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: db_test_base.py,v 1.64 2006-01-30 00:36:26 richard Exp $
18+
# $Id: db_test_base.py,v 1.65 2006-02-07 04:14:32 richard Exp $
1919

2020
import unittest, os, shutil, errno, imp, sys, time, pprint, sets
2121

@@ -26,7 +26,7 @@
2626
from mocknull import MockNull
2727

2828
config = configuration.CoreConfig()
29-
config.DATABASE = "_test_dir"
29+
config.DATABASE = "db"
3030
config.RDBMS_NAME = "rounduptest"
3131
config.RDBMS_HOST = "localhost"
3232
config.RDBMS_USER = "rounduptest"
@@ -1108,7 +1108,7 @@ def testImportExport(self):
11081108
for itemprops in items[1:]:
11091109
id = int(klass.import_list(names, itemprops))
11101110
if hasattr(klass, 'import_files'):
1111-
klass.import_files('_test_export', id)
1111+
klass.import_files('_test_export', str(id))
11121112
maxid = max(maxid, id)
11131113
self.db.setid(cn, str(maxid+1))
11141114
klass.import_journals(journals[cn])

test/test_indexer.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@
1818
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
1919
# SOFTWARE.
2020

21-
# $Id: test_indexer.py,v 1.8 2005-04-28 09:06:09 richard Exp $
21+
# $Id: test_indexer.py,v 1.9 2006-02-07 04:14:32 richard Exp $
2222

2323
import os, unittest, shutil
2424

2525
class db:
26-
class config:
26+
class config(dict):
2727
DATABASE = 'test-index'
28+
config = config()
29+
config[('main', 'indexer_stopwords')] = []
2830

2931
class IndexerTest(unittest.TestCase):
3032
def setUp(self):
@@ -44,6 +46,10 @@ def test_basics(self):
4446
self.assertEqual(self.dex.find(['blah']), [('test', '2', 'foo')])
4547
self.assertEqual(self.dex.find(['blah', 'hello']), [])
4648

49+
# change
50+
self.dex.add_text(('test', '1', 'foo'), 'a the hello')
51+
self.assertEqual(self.dex.find(['world']), [('test', '2', 'foo')])
52+
4753
def tearDown(self):
4854
shutil.rmtree('test-index')
4955

0 commit comments

Comments
 (0)