Esempio n. 1
0
    def test_logging_handler(self):
        self.simulate_get("/list", headers=self._hdrs)

        # NOTE(TheSriram): Create a new LOG handler, and make sure the
        # the next time we try to create one, we receive the one created
        # earlier.

        LOG_new = logging.getLogger(__name__)
        LOG_exists = logging.getLogger(__name__)

        self.assertEqual(LOG_new, LOG_exists)
Esempio n. 2
0
# limitations under the License.

#
# Module can be simply actived as a uWsgi service app.
# Example is in bin/authserv
#


import falcon
from stealth.impl_rax.auth_token import AdminToken
from stealth.impl_rax import token_validation
from stealth import conf

import stealth.util.log as logging

LOG = logging.getLogger(__name__)


def _http_precondition_failed(start_response):
    """Responds with HTTP 412."""
    start_response(falcon.HTTP_412, [('Content-Length', '0')])
    return []


def _http_unauthorized(start_response):
    """Responds with HTTP 401."""
    start_response(falcon.HTTP_401, [('Content-Length', '0')])
    return []


def app(redis_client, auth_url=None, admin_name=None, admin_pass=None):
Esempio n. 3
0
 def serve_forever(self):
     LOG = logging.getLogger(__name__)
     LOG.info("Mock Server - Started")
Esempio n. 4
0
    def test_logging_withoutcontext(self):

        LOG = logging.getLogger(__name__)
        with LogCapture() as capture:
            LOG.info("Testing Request ID outside wsgi call")