1
0
Fork 0
forked from github/pelican

unit tests for settings.py

This commit is contained in:
Sethathi Morokole 2014-11-11 15:26:13 +02:00
commit 90edf14beb

View file

@ -112,3 +112,22 @@ class TestSettingsConfiguration(unittest.TestCase):
configure_settings(self.settings)
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)