Mercurial > p > roundup > code
diff test/test_indexer.py @ 7851:5be92f16a684
test: fix test_indexer for change from list to tuples in config.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 31 Mar 2024 01:44:48 -0400 |
| parents | d17e57220a62 |
| children | 94aafe3b0a0d |
line wrap: on
line diff
--- a/test/test_indexer.py Sun Mar 31 00:51:45 2024 -0400 +++ b/test/test_indexer.py Sun Mar 31 01:44:48 2024 -0400 @@ -339,14 +339,17 @@ # 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 @@ 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 @@ 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
