Skip to content

Commit ec9d00b

Browse files
committed
test: fix test_indexer for change from list to tuples in config.
1 parent 12918e5 commit ec9d00b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/test_indexer.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,14 +339,17 @@ def test_invalid_indexer(self):
339339
# mangle things so we can test AssertionError at end
340340
# get_indexer()
341341
from roundup.configuration import IndexerOption
342-
IndexerOption.allowed.append("unrecognized_indexer")
342+
io_orig = IndexerOption.allowed
343+
io = list(io_orig)
344+
io.append("unrecognized_indexer")
345+
IndexerOption.allowed = tuple(io)
343346
self.db.config['INDEXER'] = "unrecognized_indexer"
344347

345348
with self.assertRaises(AssertionError) as cm:
346349
indexer = get_indexer(self.db.config, self.db)
347350

348351
# unmangle state
349-
IndexerOption.allowed.pop()
352+
IndexerOption.allowed = io_orig
350353
self.assertNotIn("unrecognized_indexer", IndexerOption.allowed)
351354
self.db.config['INDEXER'] = ""
352355

@@ -580,7 +583,10 @@ def test_invalid_language(self):
580583
import psycopg2
581584

582585
from roundup.configuration import IndexerOption
583-
IndexerOption.valid_langs.append("foo")
586+
io_orig = IndexerOption.valid_langs
587+
588+
io = list(io_orig)
589+
io.append("foo")
584590
self.db.config["INDEXER_LANGUAGE"] = "foo"
585591

586592
with self.assertRaises(psycopg2.errors.UndefinedObject) as ctx:
@@ -596,6 +602,7 @@ def test_invalid_language(self):
596602
self.db.rollback()
597603

598604
self.db.config["INDEXER_LANGUAGE"] = "english"
605+
IndexerOption.valid_langs = io_orig
599606

600607
def testNullChar(self):
601608
"""Test with null char in string. Postgres FTS throws a ValueError

0 commit comments

Comments
 (0)