diff roundup/configuration.py @ 6363:08e209a7f22b

Use OptionValueError for indexer_language error, add configuration tests Added more tests for configuration.py. This is the last of the easy to do tests for the module. While doing that figured out how to get the proper arguments to generate OptionValueError if indexer_language is invalid. Changed implementation to generate same and updated test.
author John Rouillard <rouilj@ieee.org>
date Tue, 30 Mar 2021 18:03:37 -0400
parents 42db48c30d31
children 1f2f7c0b8968
line wrap: on
line diff
--- a/roundup/configuration.py	Tue Mar 30 12:45:09 2021 -0400
+++ b/roundup/configuration.py	Tue Mar 30 18:03:37 2021 -0400
@@ -1881,13 +1881,8 @@
                     languages = textwrap.fill(_("Valid languages: ") +
                                               lang_avail, 75,
                                               subsequent_indent="   ")
-                    raise ValueError(
-                        _("Invalid indexer_language '%(lang)s' in config.ini for xapian indexer\n\n"
-                          "%(valid)s") % {
-                              "lang": lang,
-                              "valid": languages
-                          }
-                    )
+                    raise OptionValueError( options["INDEXER_LANGUAGE"],
+                                            lang, languages)
 
     def load(self, home_dir):
         """Load configuration from path designated by home_dir argument"""

Roundup Issue Tracker: http://roundup-tracker.org/