mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Added extra tests to help prevent regression.
This commit is contained in:
parent
644fd4ed5f
commit
663d1e7347
1 changed files with 16 additions and 0 deletions
|
|
@ -37,6 +37,22 @@ class TestSettingsConfiguration(unittest.TestCase):
|
||||||
self.maxDiff = None
|
self.maxDiff = None
|
||||||
self.assertDictEqual(settings, expected)
|
self.assertDictEqual(settings, expected)
|
||||||
|
|
||||||
|
def test_settings_return_independent(self):
|
||||||
|
"""Make sure that the results from one settings call doesn't
|
||||||
|
effect past or future instances."""
|
||||||
|
self.PATH = abspath(dirname(__file__))
|
||||||
|
default_conf = join(self.PATH, 'default_conf.py')
|
||||||
|
settings = read_settings(default_conf)
|
||||||
|
settings['SITEURL'] = 'new-value'
|
||||||
|
new_settings = read_settings(default_conf)
|
||||||
|
self.assertNotEqual(new_settings['SITEURL'], settings['SITEURL'])
|
||||||
|
|
||||||
|
def test_defaults_not_overwritten(self):
|
||||||
|
"""This assumes 'SITENAME': 'A Pelican Blog'"""
|
||||||
|
settings = read_settings(None)
|
||||||
|
settings['SITENAME'] = 'Not a Pelican Blog'
|
||||||
|
self.assertNotEqual(settings['SITENAME'], _DEFAULT_CONFIG['SITENAME'])
|
||||||
|
|
||||||
def test_configure_settings(self):
|
def test_configure_settings(self):
|
||||||
"""Manipulations to settings should be applied correctly."""
|
"""Manipulations to settings should be applied correctly."""
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue