From d25eedd1a55444366a2c38ef2f646f1d68892499 Mon Sep 17 00:00:00 2001 From: Kevin Dangoor Date: Fri, 18 Dec 2009 10:12:42 -0500 Subject: [PATCH] only add errors to the metadata when there are errors --- bespin/plugins.py | 3 ++- bespin/tests/test_plugins.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/bespin/plugins.py b/bespin/plugins.py index ee1f8bc..289e2fc 100644 --- a/bespin/plugins.py +++ b/bespin/plugins.py @@ -141,7 +141,8 @@ class Plugin(object): for stylesheet in self.stylesheets ] - md['errors'] = self._errors + if self._errors: + md['errors'] = self._errors self._metadata = md return md diff --git a/bespin/tests/test_plugins.py b/bespin/tests/test_plugins.py index 2e43cbd..93f6343 100644 --- a/bespin/tests/test_plugins.py +++ b/bespin/tests/test_plugins.py @@ -182,6 +182,8 @@ def test_default_plugin_registration(): assert "plugin/file/testplugins/plugin1/resources/foo/foo.css" in response.body assert "NOT THERE" not in response.body data = loads(response.body) + md = data["plugin1"] + assert "errors" not in md assert "plugin3" in data md = data['plugin3'] assert "errors" in md