mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
unit tests for settings.py
This commit is contained in:
parent
30b8a2069e
commit
90edf14beb
1 changed files with 19 additions and 0 deletions
|
|
@ -112,3 +112,22 @@ class TestSettingsConfiguration(unittest.TestCase):
|
||||||
|
|
||||||
configure_settings(self.settings)
|
configure_settings(self.settings)
|
||||||
self.assertEqual(locale.getlocale(), locale.getdefaultlocale())
|
self.assertEqual(locale.getlocale(), locale.getdefaultlocale())
|
||||||
|
|
||||||
|
def test_invalid_settings_throw_exception(self):
|
||||||
|
# Test that the path name is valid
|
||||||
|
|
||||||
|
# test that 'PATH' is set
|
||||||
|
settings = {
|
||||||
|
}
|
||||||
|
|
||||||
|
self.assertRaises(Exception, configure_settings, settings)
|
||||||
|
|
||||||
|
# Test that 'PATH' is valid
|
||||||
|
settings['PATH'] = ''
|
||||||
|
self.assertRaises(Exception, configure_settings, settings)
|
||||||
|
|
||||||
|
# Test nonexistent THEME
|
||||||
|
settings['PATH'] = os.curdir
|
||||||
|
settings['THEME'] = 'foo'
|
||||||
|
|
||||||
|
self.assertRaises(Exception, configure_settings, settings)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue