# Path: mozsvc/config.py
# def get_configurator(global_config, **settings):
#     """Create a pyramid Configurator and populate it with sensible defaults.
# 
#     This function is a helper to create and pre-populate a Configurator
#     object using the given paste-deploy settings dicts.  It uses the
#     mozsvc.config module to flatten the config paste-deploy config file
#     into the settings dict so that non-mozsvc pyramid apps can read values
#     from it easily.
#     """
#     # Populate a SettingsDict with settings from the deployment file.
#     settings = SettingsDict(settings)
#     config_file = global_config.get('__file__')
#     if config_file is not None:
#         load_into_settings(config_file, settings)
#     # Update with default pyramid settings, and then insert for all to use.
#     config = Configurator(settings={})
#     settings.setdefaults(config.registry.settings)
#     config.registry.settings = settings
#     return config


import os
import sys
import unittest2
import urllib.parse
from pyramid.request import Request
from pyramid.interfaces import IRequestFactory
from webtest import TestApp
from wsgiproxy import HostProxy as WSGIProxyApp
from mozsvc.config import get_configurator
    my_environ["wsgi.multiprocess"] = True
    my_environ["wsgi.run_once"] = False
    my_environ["wsgi.url_scheme"] = "http"
    my_environ["REQUEST_METHOD"] = "GET"
    my_environ["SCRIPT_NAME"] = ""
    my_environ["PATH_INFO"] = path
    my_environ["SERVER_NAME"] = "localhost"
    my_environ["SERVER_PORT"] = "5000"
    if environ is not None:
        my_environ.update(environ)
    if factory is None:
        factory = config.registry.queryUtility(IRequestFactory)
        if factory is None:
            factory = Request
    request = factory(my_environ)
    request.registry = config.registry
    return request


class TestCase(unittest2.TestCase):
    """TestCase with some generic helper methods."""

    def setUp(self):
        super(TestCase, self).setUp()
        self.config = self.get_configurator()

    def tearDown(self):
        self.config.end()
        super(TestCase, self).tearDown()


# Path: mozsvc/config.py
# def get_configurator(global_config, **settings):
#     """Create a pyramid Configurator and populate it with sensible defaults.
# 
#     This function is a helper to create and pre-populate a Configurator
#     object using the given paste-deploy settings dicts.  It uses the
#     mozsvc.config module to flatten the config paste-deploy config file
#     into the settings dict so that non-mozsvc pyramid apps can read values
#     from it easily.
#     """
#     # Populate a SettingsDict with settings from the deployment file.
#     settings = SettingsDict(settings)
#     config_file = global_config.get('__file__')
#     if config_file is not None:
#         load_into_settings(config_file, settings)
#     # Update with default pyramid settings, and then insert for all to use.
#     config = Configurator(settings={})
#     settings.setdefaults(config.registry.settings)
#     config.registry.settings = settings
#     return config


# Path: mozsvc/tests/support.py
import os
import sys
import unittest2
import urllib.parse
from pyramid.request import Request
from pyramid.interfaces import IRequestFactory
from webtest import TestApp
from wsgiproxy import HostProxy as WSGIProxyApp
from mozsvc.config import get_configurator

    my_environ["wsgi.multiprocess"] = True
    my_environ["wsgi.run_once"] = False
    my_environ["wsgi.url_scheme"] = "http"
    my_environ["REQUEST_METHOD"] = "GET"
    my_environ["SCRIPT_NAME"] = ""
    my_environ["PATH_INFO"] = path
    my_environ["SERVER_NAME"] = "localhost"
    my_environ["SERVER_PORT"] = "5000"
    if environ is not None:
        my_environ.update(environ)
    if factory is None:
        factory = config.registry.queryUtility(IRequestFactory)
        if factory is None:
            factory = Request
    request = factory(my_environ)
    request.registry = config.registry
    return request


class TestCase(unittest2.TestCase):
    """TestCase with some generic helper methods."""

    def setUp(self):
        super(TestCase, self).setUp()
        self.config = self.get_configurator()

    def tearDown(self):
        self.config.end()
        super(TestCase, self).tearDown()


    def get_configurator(self):