From 5aeca4826c496462ff191e6e6c498e4dad6c2cff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Sun, 10 Mar 2013 22:42:46 -0700 Subject: [PATCH] Use comments in tests, not docstrings. --- pelican/tests/test_readers.py | 4 ++-- pelican/tests/test_settings.py | 14 +++++++------- pelican/tests/test_utils.py | 4 ++-- pelican/tests/test_webassets.py | 8 ++++---- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index 50e9e0ba..ec88781b 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -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')) diff --git a/pelican/tests/test_settings.py b/pelican/tests/test_settings.py index b50169f6..d9bca2e5 100644 --- a/pelican/tests/test_settings.py +++ b/pelican/tests/test_settings.py @@ -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/', diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index 0da1dcfa..ab9ae226 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -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') diff --git a/pelican/tests/test_webassets.py b/pelican/tests/test_webassets.py index c2ba44da..22c0ae78 100644 --- a/pelican/tests/test_webassets.py +++ b/pelican/tests/test_webassets.py @@ -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))