← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/exclude-lpnet-template into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/exclude-lpnet-template into lp:launchpad.

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/exclude-lpnet-template/+merge/52497

This branch excludes the 'lpnet-template' production config from testing, since it's not valid on its own.
-- 
https://code.launchpad.net/~wgrant/launchpad/exclude-lpnet-template/+merge/52497
Your team Launchpad code reviewers is requested to review the proposed merge of lp:~wgrant/launchpad/exclude-lpnet-template into lp:launchpad.
=== modified file 'lib/canonical/config/tests/test_config.py'
--- lib/canonical/config/tests/test_config.py	2010-07-14 14:11:15 +0000
+++ lib/canonical/config/tests/test_config.py	2011-03-08 00:08:43 +0000
@@ -9,7 +9,6 @@
 
 __metaclass__ = type
 
-import ZConfig
 from doctest import DocTestSuite, NORMALIZE_WHITESPACE, ELLIPSIS
 import os
 import pkg_resources
@@ -17,10 +16,14 @@
 
 from lazr.config import ConfigSchema
 from lazr.config.interfaces import ConfigErrors
-
+import ZConfig
+
+import canonical.config
+
+# Configs that shouldn't be tested.
+EXCLUDED_CONFIGS = ['lpnet-template']
 
 # Calculate some landmark paths.
-import canonical.config
 schema_file = pkg_resources.resource_filename('zope.app.server', 'schema.xml')
 schema = ZConfig.loadSchema(schema_file)
 
@@ -67,12 +70,14 @@
     suite = unittest.TestSuite()
     suite.addTest(DocTestSuite(
         'canonical.config',
-        optionflags=NORMALIZE_WHITESPACE | ELLIPSIS
+        optionflags=NORMALIZE_WHITESPACE | ELLIPSIS,
         ))
     # Add a test for every launchpad[.lazr].conf file in our tree.
     for config_dir in canonical.config.CONFIG_ROOT_DIRS:
         prefix_len = len(os.path.dirname(config_dir)) + 1
         for dirpath, dirnames, filenames in os.walk(config_dir):
+            if os.path.basename(dirpath) in EXCLUDED_CONFIGS:
+                continue
             for filename in filenames:
                 if filename == 'launchpad.conf':
                     config_file = os.path.join(dirpath, filename)