コード例 #1
0
ファイル: test_utils.py プロジェクト: abadger/warehouse
def test_get_wsgi_application(environ):
    obj = pretend.stub()
    klass = pretend.stub(from_yaml=pretend.call_recorder(lambda *a, **k: obj))

    app = get_wsgi_application(environ, klass)
    config = environ.get("WAREHOUSE_CONF")
    configs = [config] if config else []

    assert app is obj
    assert klass.from_yaml.calls == [pretend.call(*configs)]
コード例 #2
0
def test_get_wsgi_application(environ):
    obj = pretend.stub()
    klass = pretend.stub(from_yaml=pretend.call_recorder(lambda *a, **k: obj))

    app = get_wsgi_application(environ, klass)
    config = environ.get("WAREHOUSE_CONF")
    configs = [config] if config else []

    assert app is obj
    assert klass.from_yaml.calls == [pretend.call(*configs)]
コード例 #3
0
# Copyright 2013 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os

from warehouse.application import Warehouse
from warehouse.utils import get_wsgi_application


application = get_wsgi_application(os.environ, Warehouse)
コード例 #4
0
ファイル: wsgi.py プロジェクト: Ivoz/warehouse
# Copyright 2013 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals

import os

from warehouse.application import Warehouse
from warehouse.utils import get_wsgi_application


application = get_wsgi_application(os.environ, Warehouse)