From ec9d00b5174bb53641b7447524c5afac42ed9067 Mon Sep 17 00:00:00 2001 From: John Rouillard Date: Sun, 31 Mar 2024 01:44:48 -0400 Subject: [PATCH] test: fix test_indexer for change from list to tuples in config. --- test/test_indexer.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/test/test_indexer.py b/test/test_indexer.py index 0494673b..94f616d0 100644 --- a/test/test_indexer.py +++ b/test/test_indexer.py @@ -339,14 +339,17 @@ def test_invalid_indexer(self): # mangle things so we can test AssertionError at end # get_indexer() from roundup.configuration import IndexerOption - IndexerOption.allowed.append("unrecognized_indexer") + io_orig = IndexerOption.allowed + io = list(io_orig) + io.append("unrecognized_indexer") + IndexerOption.allowed = tuple(io) self.db.config['INDEXER'] = "unrecognized_indexer" with self.assertRaises(AssertionError) as cm: indexer = get_indexer(self.db.config, self.db) # unmangle state - IndexerOption.allowed.pop() + IndexerOption.allowed = io_orig self.assertNotIn("unrecognized_indexer", IndexerOption.allowed) self.db.config['INDEXER'] = "" @@ -580,7 +583,10 @@ def test_invalid_language(self): import psycopg2 from roundup.configuration import IndexerOption - IndexerOption.valid_langs.append("foo") + io_orig = IndexerOption.valid_langs + + io = list(io_orig) + io.append("foo") self.db.config["INDEXER_LANGUAGE"] = "foo" with self.assertRaises(psycopg2.errors.UndefinedObject) as ctx: @@ -596,6 +602,7 @@ def test_invalid_language(self): self.db.rollback() self.db.config["INDEXER_LANGUAGE"] = "english" + IndexerOption.valid_langs = io_orig def testNullChar(self): """Test with null char in string. Postgres FTS throws a ValueError