mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Use comments in tests, not docstrings.
This commit is contained in:
parent
fa77c3d66a
commit
5aeca4826c
4 changed files with 15 additions and 15 deletions
|
|
@ -80,7 +80,7 @@ class RstReaderTest(unittest.TestCase):
|
|||
self.assertEquals(value, expected[key], key)
|
||||
|
||||
def test_article_metadata_key_lowercase(self):
|
||||
"""Keys of metadata should be lowercase."""
|
||||
# Keys of metadata should be lowercase.
|
||||
reader = readers.RstReader({})
|
||||
content, metadata = reader.read(
|
||||
_path('article_with_uppercase_metadata.rst'))
|
||||
|
|
@ -317,7 +317,7 @@ class HTMLReaderTest(unittest.TestCase):
|
|||
''', content)
|
||||
|
||||
def test_article_metadata_key_lowercase(self):
|
||||
"""Keys of metadata should be lowercase."""
|
||||
# Keys of metadata should be lowercase.
|
||||
reader = readers.HTMLReader({})
|
||||
content, metadata = reader.read(
|
||||
_path('article_with_uppercase_metadata.html'))
|
||||
|
|
|
|||
|
|
@ -24,16 +24,16 @@ class TestSettingsConfiguration(unittest.TestCase):
|
|||
'http://blog.notmyidea.org')
|
||||
|
||||
def test_keep_default_settings(self):
|
||||
"""keep default settings if not defined"""
|
||||
# Keep default settings if not defined.
|
||||
self.assertEqual(self.settings.get('DEFAULT_CATEGORY'),
|
||||
_DEFAULT_CONFIG['DEFAULT_CATEGORY'])
|
||||
|
||||
def test_dont_copy_small_keys(self):
|
||||
"""do not copy keys not in caps."""
|
||||
# Do not copy keys not in caps.
|
||||
self.assertNotIn('foobar', self.settings)
|
||||
|
||||
def test_read_empty_settings(self):
|
||||
"""providing no file should return the default values."""
|
||||
# Providing no file should return the default values.
|
||||
settings = read_settings(None)
|
||||
expected = copy.deepcopy(_DEFAULT_CONFIG)
|
||||
expected['FEED_DOMAIN'] = '' # Added by configure settings
|
||||
|
|
@ -41,8 +41,8 @@ class TestSettingsConfiguration(unittest.TestCase):
|
|||
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."""
|
||||
# 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)
|
||||
|
|
@ -51,13 +51,13 @@ class TestSettingsConfiguration(unittest.TestCase):
|
|||
self.assertNotEqual(new_settings['SITEURL'], settings['SITEURL'])
|
||||
|
||||
def test_defaults_not_overwritten(self):
|
||||
"""This assumes 'SITENAME': 'A Pelican Blog'"""
|
||||
# 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):
|
||||
"""Manipulations to settings should be applied correctly."""
|
||||
#Manipulations to settings should be applied correctly.
|
||||
|
||||
settings = {
|
||||
'SITEURL': 'http://blog.notmyidea.org/',
|
||||
|
|
|
|||
|
|
@ -95,8 +95,8 @@ class TestUtils(LoggedTestCase):
|
|||
self.assertNotIn(fr_article1, index)
|
||||
|
||||
def test_files_changed(self):
|
||||
"""Test if file changes are correctly detected
|
||||
Make sure to handle not getting any files correctly"""
|
||||
# Test if file changes are correctly detected
|
||||
# Make sure to handle not getting any files correctly.
|
||||
|
||||
dirname = os.path.join(os.path.dirname(__file__), 'content')
|
||||
path = os.path.join(dirname, 'article_with_metadata.rst')
|
||||
|
|
|
|||
|
|
@ -55,13 +55,13 @@ class TestWebAssetsRelativeURLS(TestWebAssets):
|
|||
"""Test pelican with relative urls."""
|
||||
|
||||
def test_jinja2_ext(self):
|
||||
"""Test that the Jinja2 extension was correctly added."""
|
||||
# Test that the Jinja2 extension was correctly added.
|
||||
|
||||
from webassets.ext.jinja2 import AssetsExtension
|
||||
self.assertIn(AssetsExtension, self.settings['JINJA_EXTENSIONS'])
|
||||
|
||||
def test_compilation(self):
|
||||
"""Compare the compiled css with the reference."""
|
||||
# Compare the compiled css with the reference.
|
||||
|
||||
gen_file = os.path.join(self.temp_path, 'theme', 'gen',
|
||||
'style.{0}.min.css'.format(CSS_HASH))
|
||||
|
|
@ -71,7 +71,7 @@ class TestWebAssetsRelativeURLS(TestWebAssets):
|
|||
self.assertEqual(css_new, CSS_REF)
|
||||
|
||||
def test_template(self):
|
||||
"""Look in the output files for the link tag."""
|
||||
# Look in the output files for the link tag.
|
||||
|
||||
css_file = './theme/gen/style.{0}.min.css'.format(CSS_HASH)
|
||||
html_files = ['index.html', 'archives.html',
|
||||
|
|
@ -92,7 +92,7 @@ class TestWebAssetsAbsoluteURLS(TestWebAssets):
|
|||
'SITEURL': 'http://localhost'})
|
||||
|
||||
def test_absolute_url(self):
|
||||
"""Look in the output files for the link tag with absolute url."""
|
||||
# Look in the output files for the link tag with absolute url.
|
||||
|
||||
css_file = ('http://localhost/theme/gen/style.{0}.min.css'
|
||||
.format(CSS_HASH))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue